One liner brain curler (for me ;-)

2002-12-15 Thread Jerry Rocteur
Hi, After you guys sent me all those wonderful links yesterday I've become a one liner freak ;-)) This one is driving me crazy, no matter how I do the unless, it always ignores it and overwrites an existing file. I've been struggling with it for hours and have tried all combinations but just

Mail::Sendmail & attachments

2002-12-15 Thread Adam Stuckey
Hello everyone, Does anyone know of a way to send attachments via the module Mail::Sendmail? Thanks. Adam Stuckey Disclaimer ___ The information contained in this e-mail and any attachments are confidential. If you are not the intended r

Re: Confused by a complex data structure

2002-12-15 Thread John W. Krahn
Rob Richardson wrote: > > Greetings! Hello, > I am trying to write a Perl script for the Cuyahoga Valley Scenic > Railroad, so that volunteers can sign up to work on trains. The > schedule file has comma-separated lines that have the date of the > train, the name of the train, and the names of

Re: One liner brain curler (for me ;-)

2002-12-15 Thread John W. Krahn
Jerry Rocteur wrote: > > Hi, Hello, > After you guys sent me all those wonderful links yesterday I've become > a one liner freak ;-)) > > This one is driving me crazy, no matter how I do the unless, it always > ignores it and overwrites an existing file. > > I've been struggling with it for ho

Re: One liner brain curler (for me ;-)

2002-12-15 Thread Jerry Rocteur
On Sunday, Dec 15, 2002, at 13:00 Europe/Brussels, John W. Krahn wrote: perl -e 'for (@ARGV) {rename $_,uc($_) unless -e "uc($_)"; } ' * What is wrong with it ??? subs/functions don't interpolate in quoted strings. perl -e'-e uc||rename($_,uc)for@ARGV' * You're incredible John.. You must be

perl and php and parseing

2002-12-15 Thread Jerry M . Howell II
Hello all, Not sure if any of you are familiar with the search tool called perlfect. but if anyone is I'm useing it to index a site and have a problem, it doesn't parse the .php files. Does anyone know if there is a way to make perl parse php files? any modules out there for this? -- Jerry M.

Re: Mail::Sendmail & attachments

2002-12-15 Thread Jerry Rocteur
From man Mail::Sendmail Look at http://alma.ch/perl/Mail-Sendmail-FAQ.htm for additional info (CGI, examples of sending attachments, HTML mail etc...) Jerry On Sunday, Dec 15, 2002, at 12:31 Europe/Brussels, Adam Stuckey wrote: Hello everyone, Does anyone know of a way to send attach

Die horribly ?

2002-12-15 Thread Mystik Gotan
Hi there, another basic Perl question up here. The last time I've seen quite some code using die horribly;. Actually, I've never seen this before. Is this a new built-in for 5.8.0? What I want to know, is wat it does. I'm sure it can't be some text, I have an idea, but I'm not sure. Please, I j

Mail::POP3Client failures,...

2002-12-15 Thread cmustard
Ok, this is very frustrating, 2 days and many hours worth! I have used this module/lib (libwww) before with ease. The only thing i can think of is i could be my linux distro? (Debian Woody 3.0), or the pop-servers encrytion methods?. The following is the exact script i am trying to run, (except w

Read-Write Mode Not Working

2002-12-15 Thread Jeff Westman
Hi, I'm using ActivePerl 5.6.1. I am trying to update an existing file. According to perlfaq5.pod, I should be able to use: open(FH, "+< /path/name"); # open for update However, I this doesn't seem to update the file for me: #--(begin)-# #! perl -w $| = 1; $file =

Re: Confused by a complex data structure

2002-12-15 Thread Rob Richardson
Hello again. None of this is working. John Krahn suggested: > push @{$trainsList{$trainDate}}, @trainData; (note the curly brackets on the outside). This gave me the following error: Can't locate object method "trainList" via package "trainDate" (perhaps you forgot to load "trainDate"?) at

Re: Die horribly ?

2002-12-15 Thread John W. Krahn
Mystik Gotan wrote: > > Hi there, Hello, > another basic Perl question up here. The last time I've seen quite some code > using die horribly;. Actually, I've never seen this before. Is this a new > built-in for 5.8.0? What I want to know, is wat it does. I'm sure it can't > be some text, I have

Embarassing new line char

2002-12-15 Thread Patricia Hinman
Hi everyone, I have a \n character in my program that won't go away. portion of program: open(CAP, ">./captions.txt")|| push(@message, "Couldn't open the captions.txt file for writing, $!"); chomp(@captions); for(my$i=0;$i<@caption;$i++){ $_ = $caption[$i];s/\n//g; #going to extremes!!! if(/^\

Re: Embarassing new line char

2002-12-15 Thread John W. Krahn
Patricia Hinman wrote: > > Hi everyone, Hello, > I have a \n character in my program that won't go > away. Are you sure? > portion of program: > > open(CAP, ">./captions.txt")|| push(@message, > "Couldn't open the captions.txt file for writing, > $!"); Do you really what to try and write to

String to Array

2002-12-15 Thread Kurt Asdal
Hello all, If I have a string, such as: $string="1, 6, 8, 10, 15"; How could I convert it to an array, such as: @array(1, 6, 8, 10, 15); Thanks.

Re: String to Array

2002-12-15 Thread John W. Krahn
Kurt Asdal wrote: > > Hello all, > > If I have a string, such as: > >$string="1, 6, 8, 10, 15"; > > How could I convert it to an array, such as: > >@array(1, 6, 8, 10, 15); Assuming that the array elements are numeric only: my @array = $string =~ /\d+/g; John -- use Perl; prog

RE: String to Array

2002-12-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
my @MyArray = (); @MyArray = split(/,\s+/, $string); This should give you what you want. Wags ;) -Original Message- From: Kurt Asdal [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 15:11 To: [EMAIL PROTECTED] Subject: String to Array Hello all, If

Re: One liner brain curler (for me ;-)

2002-12-15 Thread John W. Krahn
Jerry Rocteur wrote: > > On Sunday, Dec 15, 2002, at 13:00 Europe/Brussels, John W. Krahn wrote: > >> perl -e 'for (@ARGV) {rename $_,uc($_) unless -e "uc($_)"; } ' * > >> What is wrong with it ??? > > > > subs/functions don't interpolate in quoted strings. > > > > perl -e'-e uc||rename($_,uc)for@

Re: Confused by a complex data structure

2002-12-15 Thread John W. Krahn
Rob Richardson wrote: > > Hello again. Hello, > None of this is working. > > John Krahn suggested: > > push @{$trainsList{$trainDate}}, @trainData; > (note the curly brackets on the outside). This gave me the following > error: > > Can't locate object method "trainList" via package "train

localtime question - zero padding - mnth discrepancy

2002-12-15 Thread Harry Putnam
I really have two questions here: 1) How can I get padded numbers in the single digit range in this script? 2) Hoping tbis isn't some glaring mistake and I'm too blind to see it. Notice how the month is off by 1 cat test.pl #!/usr/local/bin/perl -w $now = time; ## 1 day = 86400

RE: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread Toby Stuart
> -Original Message- > From: Harry Putnam [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 3:15 PM > To: [EMAIL PROTECTED] > Subject: localtime question - zero padding - mnth discrepancy > > > > I really have two questions here: > > 1) How can I get padded numbers in the s

FW: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread Toby Stuart
> -Original Message- > From: Toby Stuart [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 4:17 PM > To: '[EMAIL PROTECTED]' > Subject: RE: localtime question - zero padding - mnth discrepancy > > > > > > -Original Message- > > From: Harry Putnam [mailto:[EMAIL PROT

Re: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread John W. Krahn
Harry Putnam wrote: > > I really have two questions here: > > 1) How can I get padded numbers in the single digit range in this >script? perldoc -f sprintf perldoc -f printf perldoc POSIX# look for the strftime function > 2) Hoping tbis isn't some glaring mistake and I'm too blind to s

again a regex help needed

2002-12-15 Thread Marco Centemeri
Hello All, I'd like to know if a file name is like namefile.ext (only one dot in the name) or namefile.xxx.z.ext (more than one dot in the name). I tried with regex: $file1='doctobepublish.new.pdf'; if ( $file1 =~ /\.{2,}/ ) { print "KO filename not properly formatted"; } else

RE: again a regex help needed

2002-12-15 Thread Aman Thind
Hi $file1='doctobepublish.new.pdf'; if ($file1 =~ /\.[^\.]*\./) { print "Multiple Dots!"; } else { print "Single Dot!"; } -aman. -Original Message- From: Marco Centemeri [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 12:41 PM To: Perl Beginners Mailing List Subject: again a

to php or to perl, that is the question

2002-12-15 Thread David T-G
Hi, all -- I am starting a project that will have a web front end and mysql back end and handle staff input (eg not general web surfers, though an Internet face may come about one day)and updating for client records and scheduling. I am comfortable with both perl and php (and expect to be much mo