Re: when to use variable vs. constant?

2008-11-12 Thread JC Janos
venience of interpolation wins out > 99% of the time. Leaning the same way the more I read. > ... compared to the runtime of the external system call. That's my case, and a good point. Thanks. --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: when to use variable vs. constant?

2008-11-12 Thread JC Janos
e.g. 'ipset' (which, along with my Shorewall firewall is the reason I'm getting started with perl in the first place) there are no available Perl modules (or at least none that I found yet), so the Question is relevant at least for them. --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

when to use variable vs. constant?

2008-11-12 Thread JC Janos
# CASE: constant use constant WHOIS2 => '/usr/bin/whois %s'; my $cmd = sprintf(WHOIS2, $ip); system($cmd); Is either case the better or correct usage here? Or are they simply interchangeable? --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
ut what happens by trial & error. Thanks. --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
"didn't need to get the file" does that mean that it DID retrieve the file, and simply determined that it wasn't necessary? Or that it 1st determined that it wasn't necessary and didn't even DL the file? --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
I stumbled on an answer. Adding "2>&1" apparently works, i.e., $result = `2>&1 $WGET $file`; Not sure if it's the only/best way. --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
modifying your script to the follwoing: >$result = `$WGET $file`; >print "Result = $result\n"; You're correct. That now outputs 2008-11-11 08:16:55 (550 KB/s) - `test.zip' saved [1517245/1517245] Result = How *can* I correctly capture that WGET output

problem with simple perl Regular Expression match

2008-11-11 Thread JC Janos
[1517245/1517245] MATCH Why doesn't the match, $result =~ m/saved/ work in the first case? --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Using perl in a Bash-script to extract IP-addresses?

2008-11-09 Thread JC Janos
in that Bash script. Can I even use Perl like this, from inside a Bash script? What would be the right way to go about this? Thanks. --JC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Parsing a mailbox and running each email through a script?

2003-08-14 Thread jc
I have a script that is invoked every time my .procmailrc filter sends it an email. This script grabs the email, looks at it and grabs data from it if applicable and puts the data into a text file. However, the filter hasn't been working lately, so I have go back to the mailspool and figure out a

Sick of installing CPAN modules

2003-08-11 Thread jc
I have parse a mailbox in order to grab data from each email. Simple enough right? So I tried to use the CPAN module Mail::MboxParser (0.17 version because the new one requires more modules than this one) I installed the prerequisite MIME::Tools (5 version, not developer) and this went fine. MIM

linked lists?

2003-02-16 Thread JC(oesd)
I just had a friend explain in some little detail about linked lists in C using structures. How would such a thing be done with Perl? This may help me understand C's version a little better. If you need more information than this, I can provide it...I think :) - Jim -- To unsubscribe, e-mail

Piping mail spool through a Perl script?

2002-05-06 Thread jc
Hello, I inherited a project where we use a procmail filter to filter emails as they come to our web server and pipe them through a perl script. The script called "filterme" goes through the email line by line and grabs information on the email, puts it into an array, and when it is finished,