Re: using file before and after when in foreach loop

2004-10-29 Thread Jeff Eggen
or ( my $index = 0; $index <= $#files; $index++ ) { } And then just use $files[$index] wherever you use $_ below, and then you can refer to as many other elements in the array as you like with "$index + 1", "$index - 1", etc. Hope this helps, Jeff Eggen IT Programmer Analyst Saskat

Re: the case of "-pe" and "-ne" swtich in Perl one liner

2004-12-02 Thread Jeff Eggen
int line numbers: perl -ne 'print "$. $_" if m/some pattern/' my_file.txt Or, say I want to rip through a file that is just a plaintext table of info with a column I want to sum: perl -ne '$total+=(split)[columnnumber];END{print $total}' my_file.txt Hope this helps,

Re: Dates

2005-01-06 Thread Jeff Eggen
>>> Tim Wolak <[EMAIL PROTECTED]> 06/01/2005 3:59:26 pm >>> >Hello all, >I am in need of a quick way to get the current date in the MMDD >format. This is something I would like to understand better on how to >get the date with perl. Any suggestions would be most welcome. As per the perlch

Blocking Signals

2005-01-31 Thread Jeff Eggen
are unblocked the signal handler for TERM should be entered, and that would cause the program to exit. Is it my logic that's wrong, or is the code doing something funky? Thanks, Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] *

Re: Clipping ALL Occurrences of a Regex in an HTML File?

2005-02-09 Thread Jeff Eggen
the "g" modifier on your regex? while (/\(.*?)<\/FONT>/g) { print $1, "\n"; } Does it pick up the rest then? Hope this helps, Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] DISCLAIMER***

Re: Number or string?

2005-02-22 Thread Jeff Eggen
differ.pl line 19, > line 1." Does your file have a header that you should be ignoring? Your error above says it's at the first line of your input file. Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] DISCLAIMER**

Dead-module etiquette

2005-03-10 Thread Jeff Eggen
to go through to pick it up myself? Thanks, Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] DISCLAIMER* This e-mail and any files transmitted with it are confidential and intended solely for the use of the in

Re: Dead-module etiquette

2005-03-11 Thread Jeff Eggen
as then I could do this pretty simply. Maybe rewriting the bugger isn't such a bad idea... Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] DISCLAIMER* This e-mail and any files transmitted with it are confidentia

Re: cannot match string

2005-05-11 Thread Jeff Eggen
directly, since bad things can happen if you trash your shadow file. Try this: for userid in `cat cleanup.txt` do echo "locking user $userid" passwd -l $userid done This should work. The "passwd -l $userid" will lock the account for you. Jeff Eggen IT Programmer Analyst Saskatch

Re: gcc compiling perl on solaris

2007-08-07 Thread Jeff Eggen
er / linker uses another method to actually load the library. I created the symlink, and everything worked okay after that. Hope this helps, Jeff Eggen IT Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] This e-mail and any files transmitted with it are confiden

Re: Perl 5.8.6 bug in open()?

2007-10-30 Thread Jeff Eggen
\s)#./$1#; open(FOO, "< $file\0"); Change your open call to use the three argument version and you should be fine. Hope this helps, Jeff Eggen IT Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] This e-mail and any files transmitted w

Re: email attachments

2005-08-04 Thread Jeff Eggen
ty comes to mind. http://search.cpan.org/~dskoll/MIME-tools-5.417/ Hope this helps, Jeff Eggen IT Programmer Analyst Saskatchewan Government Insurance Ph (306) 751-1795 email [EMAIL PROTECTED] DISCLAIMER* This e-mail and any files transmitted with it are confidential and inten

Re: "Join" Function

2005-08-08 Thread Jeff Eggen
# The "or die" is the preferred way of checking open success, by the way # Also, note the use of "$!" to determine failure cause open DNAFILE, $file or die "Cannot open file: $!"; my $dna = join '', ; close DNAFILE; # Now we get rid of any newlines $d

Listing available template variables using Template Toolkit

2006-03-16 Thread Jeff Eggen
r method / function in the toolkit? I'm looking through the docs and the "Perl Template Toolkit" book by O'Reilly, but haven't seen anything yet. If anyone could point me in the right direction, I'd appreciate it. Thanks, Jeff Eggen IT Programmer Analyst Saskatch