I have a foreach loop that operates on the elements of an array. However, the size of the array is variable. Here is the code segment:
if ($#name>1) {
.
.
.
foreach my $part ($name[2..$#name]) {
.
.
.
Occasionally $#name will evaluate to 2. That seems to be...
I need to follow some links using LWP (simple). However, some of the links are relative. Does anyone have an easy way to parse a relative URL to complete it? TIA.
I have been racking my brain to come up with an efficient way to parse a string. I am hoping those more experienced then me can come up with something. I suspect a regexp is the answer if I can come up with the right template but I am not a regexp expert.
I need to parse a string that contains...
I am about to attempt my first recursive application. While researching it there seems to be some caveats with respect to recursion in perl. Does anyone have any general advice about common gotchas with perl recursion? TIA.
I have a working script but it produces some warnings. In the interest of cleaning it up and learning a little more about perl, could someone advise me what is causing the errors?
Here is the script:
[COLOR=green]
#!/usr/bin/perl -w
use Strict;
use Net::POP3;
use Authen::Krb5;
use Authen::SASL...
I have the following partially written script:
#!/usr/bin/perl -w
#
# This script fixes the AWStats config file so the current IP address is
# included in the statistics
#
use strict;
my $awcfgfile = "awstats.conf";
my $awcfgdir = "/etc/awstats";
my $tmpcfgfile = "awstatsnew.conf"...
I am just starting to look at Cisco's intrusion prevention feature. I'd like to implement it but I have a few questions. How complete is the SDF file provided by Cisco? Is there a recommended source for SDF files that are "importable". It seems that the number of signatures is limited by memory...
I have a function that returns a file handle. I am confused about how to read when an 'open' is not used. I understand reading this way:
open (FILEHANDLE,"myfile.txt");
my $line=<FILEHANDLE>;
In my case I have a function that returns a filehandle:
$pop->get($msgnum,my $fh);
my $line=<$fh>...
This is driving me nuts and I need some new eyes to figure out what I'm doing wrong. I have several subnets that are set up for reverse lookup. One is not working but for the life of me I cannot see what is wrong. The file loads on the master with no errors, however, when I attempt to look up...
I need to suppress the URL that comes out when I print a popup page. Is there a way to do that? Here is the function that creates and prints the page:
function startFax(theForm) {
newwindow=window.open("","printwin","height=450,width=600");
newwindow.document.write("<body...
I created a popup window for printing some textarea information and have 2 problems. The function I use is:
function startFax(theForm) {
newwindow=window.open("","printwin","height=450,width=600");
newwindow.document.write("<body...
I have a preformatted textarea that my user can edit. Once done I want the user to be able to print the content of the textarea. I set up a javascript to do that but it prints the entire page rather then just the textarea. How do I print just that part? TIA.
function startPrint(theForm) {...
I am trying to use the perl cookbook to write a script to process POP mail (Recipe 18.5) and getting a compile error. The problem code is:
use strict:
use Net::POP3;
my $pop=Net::POP3->new("mail.mydomain.com")
or die "Mail server not responding: ",$!,"\n";
defined...
I'm not really sure where to ask this question but I'll start here as it seems the most logical. I am trying to write a perl script that will access mail via POP3/IMAP. The POP/IMAP server requires Kerberos authentication. I know how to do most of the Kerberos stuff (sendauth) but two things I...
I am trying to write a script that can authenticate to a POP3 server that accepts Kerberos only. I thought I needed Authen::Krb5 but apparently that is not the case. That module seems geared to administration. What I need is an example script for obtaining a POP3 ticket and accessing a POP3...
I have a bunch of VCards that was sent to me as a vcf file. How do I import these into Eudora? I can find all kinds of info for importing LDIF but not VCards. TIA.
I have a PHP script that extracts a bunch of data and formats it. Now I want to download it to the client rather then just display it as garbage in the browser. How do I accomplish that? Is this one of those occasions where I need to use the PHP header function? I can't seem to come up with the...
Apparently there is a way to get an HTTP server to return its version number. I suspect that it can't be done with just an ordinary browser but might be possible with a perl script using LWP. Does someone know how to accomplish this? TIA.
I am having a problem handling directories that contain spaces. I guess it is a matter of using quotes properly but I cannot seem to come up with the correct syntax. My first problem is passing such a directory to a script such that it is treated as a single argument rather then individual...
I am trying to set up an unattended backup using dump. I am dumping to a hard drive across my network. My problem is that one of the filesystems generates a file larger then 2G. I canot seem to get the right options so that it does not require operator intervention. It seems that the 'f' and 'M'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.