Re: Confirmation... but, what if....

2001-12-05 Thread Jeff 'japhy' Pinyan
On Dec 6, Daniel Falkenberg said: >What if $string does not meet the criteria in s/[^a-zA-Z0-9]+//g; can I >get a print statement to say... > >if ($string ne s/[^a-zA-Z0-9]+//g) { > print "$string does not meet our criteria...! Please try another >password\n"; >} You mean, "how can I see if a s

Confirmation... but, what if....

2001-12-05 Thread Daniel Falkenberg
List, What if $string does not meet the criteria in s/[^a-zA-Z0-9]+//g; can I get a print statement to say... if ($string ne s/[^a-zA-Z0-9]+//g) { print "$string does not meet our criteria...! Please try another password\n"; } Is this OK Dan -Original Message- From: Jeff 'japhy

Re: Confirmation...

2001-12-05 Thread Jeff 'japhy' Pinyan
On Dec 6, Daniel Falkenberg said: >$string =~ s/[^a-zA-Z0-9]//g; > >I take it only allows $string to eq anthing in the charcter class of >a-z, A-Z and 0-9. I also take it that anything other than that will be >stripped out? Any other comments? Right. I'd write it as s/[^a-zA-Z0-9]+//g; fo

Confirmation...

2001-12-05 Thread Daniel Falkenberg
List, Just a quick question of confirmation as to what the following REs does... $string =~ s/[^a-zA-Z0-9]//g; I take it only allows $string to eq anthing in the charcter class of a-z, A-Z and 0-9. I also take it that anything other than that will be stripped out? Any other comments? Regards

FW: Long variable again

2001-12-05 Thread Daniel Falkenberg
> Hey again all! > > $string = "attack. The password for $user_to_change should not have > to be changed.\n". > "-" x 70, "\n Hello". > "Thank you for using our software.\n\n"; > > Now I have been informed to replace the , with a . at the second line > of the string near 70.

error when exit codes returns 0

2001-12-05 Thread J-E-N
hope someone could help me out. when the exit code returns 0, the page displays "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request." but the fetchmail was done successfully. $fetch = system ("/usr/bin/fetchmail -aK -f/tm

Re: Large variable...

2001-12-05 Thread Jeff 'japhy' Pinyan
On Dec 6, Daniel Falkenberg said: >$string = "\nHELLO WORLD!\n\n". > "To $to, \n\n". > "\n". "-" x 70, "\n Hello World". > "Thank you for using our software.\n\n"; You have a , where you want a . instead. Using warnings would've picked this up and told you that yo

Large variable...

2001-12-05 Thread Daniel Falkenberg
Hey all, $string = "\nHELLO WORLD!\n\n". "To $to, \n\n". "\n". "-" x 70, "\n Hello World". "Thank you for using our software.\n\n"; My problem is that my variable $string dies or doesn't print (if you wish :) ) anything after the 70,. Is there something I am do

Re: Converting UNIX script to run under MIIS

2001-12-05 Thread Curtis Poe
--- Claude Jones <[EMAIL PROTECTED]> wrote: > This is my first post, and I hope it's not too newbie even for a list with > this name. I'm just beginning to learn Perl and I have successfully got some > scripts working on our website to handle form submissions. We are in process > of bringing our s

RE: today's date....

2001-12-05 Thread Wagner-David
Not needed as part of core. Should have no problems on other systems. I run on nt4, w2k and tandem w/ only minor changes going on in between. Wags ;) ps The reason is the way the individual wanted the date printed. If acceptable as to one you were, it is very small and compact. -O

RE: today's date....

2001-12-05 Thread Matt Richter
Hmmm.. I've seen these examples in books and previously on this list. I'm surprised by the amount code it takes to display the current date. On my script which outputs to html (i.e. a cgi script), I have the following $ltime = localtime(); print "$ltime\n"; Which prints: Wed Dec 5 17

RE: perl script to remove control M's

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Chris Spurgeon wrote: > perl -i.bak -npe 's/\r\n/\n/g' You don't need to use -n and -p together, -p does the same as -n, but prints the line. -- Brett http://www.chapelperilous.net/ --

Converting UNIX script to run under MIIS

2001-12-05 Thread Claude Jones
This is my first post, and I hope it's not too newbie even for a list with this name. I'm just beginning to learn Perl and I have successfully got some scripts working on our website to handle form submissions. We are in process of bringing our site in house, where we will host on a MIIS server. C

RE: perl script to remove control M's

2001-12-05 Thread Ahmed Moustafa
This programs exists for Windows also. --Ahmed [EMAIL PROTECTED] | http://arbornet.org/~ahmed On Wed, 5 Dec 2001, Sidharth Malhotra wrote: > Most unix systems have a program called dos2unix that does the same > thing. > % man dos2unix > % dos2unix sourcefile targetfile > > Hth. Sid. > >

RE: perl script to remove control M's

2001-12-05 Thread Chris Spurgeon
Sho nuff. Hell, for that matter, you can just blow them all away from within emacs. Chris Spurgeon Senior Design Technologist [EMAIL PROTECTED] ELECTRONIC INK One South Broad Street 19th Floor Philadelphia, PA 19107 www.electronicink.com t 215.922.3800 x(233) f 215.922.388

RE: perl script to remove control M's

2001-12-05 Thread Sidharth Malhotra
Most unix systems have a program called dos2unix that does the same thing. % man dos2unix % dos2unix sourcefile targetfile Hth. Sid. -Original Message- From: Chris Spurgeon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 5:41 PM To: 'Booher Timothy B 1stLt AFRL/MNAC'; [EM

RE: perl script to remove control M's

2001-12-05 Thread Chris Spurgeon
perl -i.bak -npe 's/\r\n/\n/g' where is the filename you want to clean. A backup copy of your original file will be created in the same directory with a ".bak" extension. Chris Spurgeon Senior Design Technologist [EMAIL PROTECTED] ELECTRONIC INK One South Broad Street 19t

Re: perl script to remove control M's

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Booher Timothy B 1stLt AFRL/MNAC wrote: > I have what seems to be a persistent problem with all files that I import > from dos into emacs. I have those control M's all over the place. > > Does anyone know of a perl script to 'clean' these files? You can do this in one line:

[Re: perl script to remove control M's]

2001-12-05 Thread Bkwyrm
#!/usr/bin/perl -i while (<>) { /\n/g;; print $_; } -- Namaste, Kristin "The universe seems neither benign nor hostile, merely indifferent." - Carl Sagan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

perl script to remove control M's

2001-12-05 Thread Booher Timothy B 1stLt AFRL/MNAC
I have what seems to be a persistent problem with all files that I import from dos into emacs. I have those control M's all over the place. Does anyone know of a perl script to 'clean' these files? Thanks so much, tim Timothy B Booher, Lt US

RE: PERL and MySQL

2001-12-05 Thread John . Brooking
It seems to me that this is more a function of the database than of Perl. Standard SQL syntax (as far as I know) doesn't define how to join tables between databases. Some databases, Oracle or Access for example, allow you to link tables between one database and another, then you can just use stand

PERL and MySQL

2001-12-05 Thread Aaron Shurts
Hey all, I am pretty new with both PERL and MySQL and I have been asked to write a report that will collect from our database how many users were dialing from a specific area code in a given time. I am totally confused on JOINS since the data I need to gather is in 2 separate databases. I was ju

Re: @s in Regular Expression

2001-12-05 Thread Jeff 'japhy' Pinyan
On Dec 5, Mark Anderson said: > if ($str =~ /@A(.*?)@B(.*?)@C(.*?)@D(.*?)@E(.*?)@F(.*?)@END/s) { > $var1 = $1; $var2 = $2; ... > } else { > print "Error message"; > } > >And it's stuffing most of $str into a sin

@s in Regular Expression

2001-12-05 Thread Mark Anderson
I have some data that is broken up by @s, stored in a string $str. I'm using the following code: if ($str =~ /@A(.*?)@B(.*?)@C(.*?)@D(.*?)@E(.*?)@F(.*?)@END/s) { $var1 = $1; $var2 = $2; ... } else { print "Error mess

Re: Help with Perl

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Nguyen, Andy wrote: > # $letter could be any letter from A to L. > if ( $letter eq "A" || $letter "B" || $letter "C" || $letter eq "D" || >$letter eq "L" ) > { > do something > } > > I really don't want to repeat $letter for every letter (B-L). I would use a r

Re: today's date....

2001-12-05 Thread Etienne Marcotte
my $day = 3; $day = sprintf("%02d", $day); it assings $day to 03 if $day is less than 10 printf does the same but prints it instead of assigning it to the variable http://www.perldoc.com/perl5.6.1/pod/func/sprintf.html http://www.perldoc.com/perl5.6.1/pod/func/printf.html Etienne Tyler Longre

Re: today's date....

2001-12-05 Thread Etienne Marcotte
it was already in my original reply == sub get_date { my @months = qw(January Febuary March April May June July August September October November December); my ($day, $mon, $yr) = (localtime)[3,4,5]; return (sprintf("%02d", $day), $months[$mon], $yr + 1900); } my ($day, $month, $ye

Re: today's date....

2001-12-05 Thread Richie Crews
I think there are currently no modules default in perl that do this, You could try the Date::Calc module. On Wed, 2001-12-05 at 15:07, Tyler Longren wrote: > I'm not sure if there's a function to do that. But you could check the > length of $DAY...if it's less than 2 you could just add a 0 infro

Re: today's date....

2001-12-05 Thread Tyler Longren
I'm not sure if there's a function to do that. But you could check the length of $DAY...if it's less than 2 you could just add a 0 infront of it. Good luck, Tyler Longren - Original Message - From: "Torres, Jose" <[EMAIL PROTECTED]> To: "'Shinagare, Sandeep'" <[EMAIL PROTECTED]>; <[EMAI

RE: today's date....

2001-12-05 Thread Torres, Jose
In the code below, is there a Perl built-in function to pass $DAY into so that a "9" comes out "09"? I need digits from 1 to 9 to be of the form 01, 02, etc. Ideas? Thanks. -Jose -Original Message- From: Shinagare, Sandeep [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001

Re: Mail::Mailer Bcc problem

2001-12-05 Thread Michael Fowler
On Mon, Dec 03, 2001 at 12:42:54PM +0100, Jenda Krynicky wrote: > From: Michael Fowler <[EMAIL PROTECTED]> > > This is a problem with your MTA (mail transport agent; e.g. sendmail, > > postfix, qmail, etc.), i.e. $server. It's the MTA's job to remove the > > header, not Mail::Mailer's. > > I don

Re: Help with Perl

2001-12-05 Thread Michael McQuarrie
Andy, Try this: if ( $letter =~ /^[A-L]$/ ) { do something; } You should be able to the same thing in ksh, just change the format a bit. -Michael McQuarrie --- "Nguyen, Andy" <[EMAIL PROTECTED]> wrote: > Hi List, > > I am new to perl and looking for a shortcut way of doing this. > > # $lett

diffs of mirror files in 2 directories

2001-12-05 Thread Roy Peters
I have 2 directories: x/y/z and a/b/c within both directories, I have the same files say a1.c thro a10.c I would like to write a perl script to go through all the files in each directory and print out the filename if there is a difference between the corresponding files. I know of many ways

RE: Help with Perl

2001-12-05 Thread Nguyen, Andy
Thank you all for your help. Andy -Original Message- From: Maurice Reeves [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 1:36 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Help with Perl if ($letter =~ m/[A-L]/) uses a regex which will give you what you want.

Re: Timimg Out A loop

2001-12-05 Thread Michael Fowler
On Fri, Nov 30, 2001 at 02:21:53PM -0500, Ken Hammer wrote: > our flag; > sub alarm_handler > { > set flag; > } > > set alarm to expire after 10 secs; > Loop indefinitely { > exit if ($flag); > my $response = $ua->request($req); > my $content = $response->content(); > }

Re: Win32: Create group, Add users

2001-12-05 Thread Michael Stidham
This ought to get you started. use Win32::NetAdmin; GroupCreate(server, group, comment); UserCreate(server, userName, password, passwordAge, privilege, homeDir, comment, flags, scriptPath); GroupAddUsers(server, groupName, users); ___

Re: Help with Perl

2001-12-05 Thread Maurice Reeves
if ($letter =~ m/[A-L]/) uses a regex which will give you what you want. >From: "Nguyen, Andy" <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: Help with Perl >Date: Wed, 5 Dec 2001 14:16:37 -0500 >Hi List, > >I am new to perl and looking for a shortcut way of doing th

Re: Help with Perl

2001-12-05 Thread Kevin Meltzer
Dag nabbit.. forgot the anchors :) if ($letter =~ /^[A-L]$/) { -- Hello Andy, if ($letter =~ /[A-L]/) { blah } See Also: perldoc perlre Cheers, Kevin On Wed, Dec 05, 2001 at 02:16:37PM -0500, Nguyen, Andy ([EMAIL PROTECTED]) said something similar to: > Hi Li

RE: Help with Perl

2001-12-05 Thread Chris Spurgeon
Probably many ways to do this but one would be if (($letter ge "A") && ($letter le "L")) { do something } Chris Spurgeon Senior Design Technologist [EMAIL PROTECTED] ELECTRONIC INK One South Broad Street 19th Floor Philadelphia, PA 19107 www.electronicink.com t 21

Re: Help with Perl

2001-12-05 Thread Kevin Meltzer
Hello Andy, if ($letter =~ /[A-L]/) { blah } See Also: perldoc perlre Cheers, Kevin On Wed, Dec 05, 2001 at 02:16:37PM -0500, Nguyen, Andy ([EMAIL PROTECTED]) said something similar to: > Hi List, > > I am new to perl and looking for a shortcut way of doing this. > > # $letter could

Win32: Create group, Add users

2001-12-05 Thread Trap 13
Hello, I want to write a script for Win32 that : - creates a users' group, - adds users to this group. Thanks for all hints, module, function names, ... -- Ce qu'il y a d'enivrant dans le mauvais goût, c'est le plaisir aristocratique de déplaire. Charles Baudelaire - Mon coeur mis à nu. -

Win32::File::Attributes

2001-12-05 Thread Michael Stidham
Need a little help with file attributes. I am trying to query a remote file to file out if is set with read-only attributes, if so I would like to remove them. Any help will be appreciated. Here is the first part, but I can't even get the value of the attributes. !#D://perl//bin//perl -w $serv

Re: Help with Perl

2001-12-05 Thread Etienne Marcotte
Jeff 'Japhy' wrote me this in a previous similar question: < You might be interested in the Quantum::Superpositions module, which allows you to write: if ($letter == any(A,B,C,D,...)) { ... } > Or maybe something like if ($letter =~ m/^[A-Z]$/) {...} HTH, Etienne "Nguyen, Andy" wrote: >

Re: Help with Perl

2001-12-05 Thread Curtis Poe
--- "Nguyen, Andy" <[EMAIL PROTECTED]> wrote: > Hi List, > > I am new to perl and looking for a shortcut way of doing this. > > # $letter could be any letter from A to L. > if ( $letter eq "A" || $letter "B" || $letter "C" || $letter eq "D" || >$letter eq > "L" ) > { > do somethi

Help with Perl

2001-12-05 Thread Nguyen, Andy
Hi List, I am new to perl and looking for a shortcut way of doing this. # $letter could be any letter from A to L. if ( $letter eq "A" || $letter "B" || $letter "C" || $letter eq "D" || $letter eq "L" ) { do something } I really don't want to repeat $letter for every letter (B-L

Re: data types

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Brett W. McCoy wrote: > Technically, Perl only has two kinds of data types -- lists and scalars. Actually, I would break that down even further into three types, scalars, arrays (of scalars) and hashes (of scalars). -- Brett http://w

Re: data types

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Ruth Albocher wrote: > I wish to use variables of type: > double/long (but not float!) > binary numbers and casting strings to binary > unsigned integers(doubled would be better!) > > can somone point me in the right direction? Technically, Perl only has two kinds of data typ

Re: data types

2001-12-05 Thread Maurice Reeves
Well, Perl doesn't have these data types explicitly (at least not yet) but what you should look at are the two functions Pack and Unpack. Pack and Unpack take scalar variables and convert them according to the format you specify. The man pages for them are quite in depth. Hope that helps. Take

data types

2001-12-05 Thread Ruth Albocher
hi all I wish to use variables of type: double/long (but not float!) binary numbers and casting strings to binary unsigned integers(doubled would be better!) can somone point me in the right direction? thanks ruthie -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Loop

2001-12-05 Thread roger
exit works to get you out of the script. - Original Message - From: "Ahmed Moustafa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, December 05, 2001 7:32 AM Subject: Re: Loop > Try using "last" instead of "break". > > - Original Message -

Re: acronym of qw

2001-12-05 Thread Peter Scott
At 12:00 PM 12/5/01 +0330, nafiseh saberi wrote: >do you know ...what is the acronym of "qw" that >use in Object-Oriented ?? It stands for "quote words". -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Re[3]: "q" as an argument

2001-12-05 Thread Jeff 'japhy' Pinyan
On Dec 5, Michael McQuarrie said: >The "use strict;" requires the arguments to all be quoted. In the real >script I am only using "use strict 'vars';". This way I can keep the >syntax of calling the sub the same as I originally had. I would like to >keep the "error_notify(e,p,x,"Message");" sy

Re: today's date....

2001-12-05 Thread Etienne Marcotte
There is more signature text than actual thread text in your posts.. Isn't it supposed to be <=4 lines? Or i'm referring to the wrong ML? Etienne [EMAIL PROTECTED] wrote: > > There are a number of date formatting routines available at > http://search.cpan.org/. > > > -Original Message---

Re: today's date....

2001-12-05 Thread Etienne Marcotte
sub get_date { my @months = qw(January Febuary March April May June July August September October November December); my ($day, $mon, $yr) = (localtime)[3,4,5]; return (sprintf("%02d", $day), $months[$mon], $yr + 1900); } my ($day, $month, $year) = get_date(); You need to "code" the conver

RE: today's date....

2001-12-05 Thread John Edwards
Try this. $thisday = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[(localtime)[6]]; $thisdate = (localtime)[3]; if ($thisdate == 1 || $thisdate == 21 || $thisdate == 31) { $thisdate .= "st"; } elsif ($thisdate == 2 || $thisdate == 22) { $thisdate .= "nd"; } elsif ($thisdate == 3 || $thisdate ==

RE: today's date....

2001-12-05 Thread John . Brooking
There are a number of date formatting routines available at http://search.cpan.org/. > -Original Message- > From: Shinagare, Sandeep [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 05, 2001 11:27 AM > To: '[EMAIL PROTECTED]' > Subject: today's date > > > Hi Folks! > Trying to

Re: traversing Windows directories

2001-12-05 Thread Luke Bakken
File::Find Or, if j:\foo\bar\logs has only 1 level of sub folders, use opendir on that dir and read the contents, finding items that are also directories, which you can then do another opendir on. Luke On Wed, 5 Dec 2001, Torres, Jose wrote: > Hi, > > How do you traverse Windows directories i

today's date....

2001-12-05 Thread Shinagare, Sandeep
Hi Folks! Trying to get todays date and month... was able to find this... #snip-start use Time::localtime; $tm = localtime; ($DAY, $MONTH, $YEAR) = ($tm->mday, $tm->mon, $tm->year); #snip-end this gives me the Day and Month in numbers.. anyway in which i can get "Mon","Tue","Wed" and "Jan

Re: traversing Windows directories

2001-12-05 Thread Ahmed Moustafa
You need to write a recursive function to scan your root dir and list all the file and directories and do the same for each one of the sub directories. Once you find the file you are looking for, return. --Ahmed [EMAIL PROTECTED] | http://arbornet.org/~ahmed On Wed, 5 Dec 2001, Torres, Jose wrot

Re: traversing Windows directories

2001-12-05 Thread Ahmed Moustafa
I think it does not matter it your system is Windows or *nix. --Ahmed [EMAIL PROTECTED] | http://arbornet.org/~ahmed On Wed, 5 Dec 2001, Torres, Jose wrote: > Hi, > > How do you traverse Windows directories in Perl? Let's say J:\foo\bar\logs > has a variable number of folders, each of which I

RE: traversing Windows directories

2001-12-05 Thread Wagner-David
Lookat File::Find which should do what you want? Here is one simple which just prints all directories under a specified top directory: use File::Find; find(\&wanted, 'x:/start/directory'); # starting directory goes here sub wanted { print "$File::Find::name\n " if ( -d $_ );

Re: copying files

2001-12-05 Thread Flavio Soibelmann Glock
On Wed, 5 Dec 2001, Shinagare, Sandeep wrote: > #snip2 > $vfilename="TestFile.txt"; > system ("copy c:\msg.txt c:\sandeep\$vfilename"); > #end Use \\ instead of \ \$ means '$' \\ means '\' - Flávio Soibelmann Glock -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

traversing Windows directories

2001-12-05 Thread Torres, Jose
Hi, How do you traverse Windows directories in Perl? Let's say J:\foo\bar\logs has a variable number of folders, each of which I want to look into for a specific file. How would I do this? Thanks for all help. -Jose -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re[4]: "q" as an argument

2001-12-05 Thread Maxim Berlin
Hello Michael, Wednesday, December 05, 2001, Michael McQuarrie <[EMAIL PROTECTED]> wrote: MM> Maxim, MM> Correction: MM> The "use strict;" requires the arguments to all be quoted. yes. MM> In the real script I am only using "use strict 'vars';". This way MM> I can keep the syntax of calling t

RE: copying files

2001-12-05 Thread Wagner-David
Need to double your \ when working with ". SO your code should look somehting like: system ("copy c:\\msg.txt c:\\sandeep\\$vfilename"); Wags ;) -Original Message- From: Shinagare, Sandeep [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 07:16 To: [EMAIL PROTECTED] S

Re: .=

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Purshottam Chandak wrote: > $fred[1] .= "whatsis"; > > Playing with this I have not found any difference between > the .= (which I would expect to do concatenation), > and the = (which I expect would do normal assignment.) > > Can someone explain what the .= is for? It's the

Re: Loop

2001-12-05 Thread Ahmed Moustafa
Try using "last" instead of "break". - Original Message - From: "Purshottam Chandak" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 05, 2001 7:19 AM Subject: Loop > i was trying to work it out, for any kind of array. > the following pseudo code doesn't seem to wor

.=

2001-12-05 Thread Purshottam Chandak
$fred[1] .= "whatsis"; Playing with this I have not found any difference between the .= (which I would expect to do concatenation), and the = (which I expect would do normal assignment.) Can someone explain what the .= is for? Pc _ Do

Re: Loop

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Purshottam Chandak wrote: > i was trying to work it out, for any kind of array. > the following pseudo code doesn't seem to work > > for(.) { > if(...) { > .. > } > else { > > break; > } > } > > the break statement is not working. Even when it comes into

Re[3]: "q" as an argument

2001-12-05 Thread Michael McQuarrie
Maxim, Correction: The "use strict;" requires the arguments to all be quoted. In the real script I am only using "use strict 'vars';". This way I can keep the syntax of calling the sub the same as I originally had. I would like to keep the "error_notify(e,p,x,"Message");" syntax. The "q" is

Re: Loop

2001-12-05 Thread Maxim Berlin
Hello Purshottam, Wednesday, December 05, 2001, Purshottam Chandak <[EMAIL PROTECTED]> wrote: PC> i was trying to work it out, for any kind of array. PC> the following pseudo code doesn't seem to work PC> for(.) { PC> if(...) { PC> .. PC> } PC> else { PC> PC> break; PC> } P

Re: copying files

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Shinagare, Sandeep wrote: > #snip1 > system ("copy c:\msg.txt c:\sandeep\msg.txt"); > #end > > which works fine. But how can i give it a dynamic file name say like... > > #snip2 > $vfilename="TestFile.txt"; > system ("copy c:\msg.txt c:\sandeep\$vfilename"); > #end > > this do

Re: Pattern match woos

2001-12-05 Thread Leon
- Original Message - From: "Dermot Paikkos" <[EMAIL PROTECTED]> > Hi there, > This is both frustrating and embarrassing. I can't capture the > following data into a variable. The line I want is: > GIAZUC00 > > I have tried a multitude of Regex, none seems to be working. Here's > my last at

Loop

2001-12-05 Thread Purshottam Chandak
i was trying to work it out, for any kind of array. the following pseudo code doesn't seem to work for(.) { if(...) { .. } else { break; } } the break statement is not working. Even when it comes into the else part, it doesn't break the for loop. Suggestions? Pc __

Re[2]: "q" as an argument

2001-12-05 Thread Michael McQuarrie
Maxim, I have set "use strict;". Below is a script to test the sub. As is the script should simply print "the script didnt work". If you change the last line of the following test script to: error_notify(q,"the script didnt work"); It fails with this message: Can't find string terminato

copying files

2001-12-05 Thread Shinagare, Sandeep
Hi, Just trying to copy a file from one location to another like this. #snip1 system ("copy c:\msg.txt c:\sandeep\msg.txt"); #end which works fine. But how can i give it a dynamic file name say like... #snip2 $vfilename="TestFile.txt"; system ("copy c:\msg.txt c:\sandeep\$vfilename"); #end thi

RE: SIMPLE SCRIPT TO REMOVE ALL SPACE FROM THE ENDS OF LINES

2001-12-05 Thread Bob Showalter
> -Original Message- > From: Booher Timothy B 1stLt AFRL/MNAC > [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 05, 2001 9:27 AM > To: [EMAIL PROTECTED] > Subject: SIMPLE SCRIPT TO REMOVE ALL SPACE FROM THE ENDS OF LINES > > > > I am looking for a simple way to go through my text

Re: Simpler....

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Daniel Falkenberg wrote: > Please don't stree to much over this one but, is there an easier way of > writing this? > > while(1){ > if ($status == 1) { > #Do this sub... > sub(); > elsif ($status == 1) { > #Do this other sub... > sub2(); > } else { > #

SIMPLE SCRIPT TO REMOVE ALL SPACE FROM THE ENDS OF LINES

2001-12-05 Thread Booher Timothy B 1stLt AFRL/MNAC
I am looking for a simple way to go through my text file and remove all spaces from the ends of lines. I have a feeling that this is real easy, but don't know what function is best: does chomp do this? Is there a feature in emacs that does this better? Thanks for any information . . . Tim, bran

Re: "q" as an argument

2001-12-05 Thread Maxim Berlin
Hello Michael, Wednesday, December 05, 2001, Michael McQuarrie <[EMAIL PROTECTED]> wrote: MM> I am defining a sub that takes only specific options: MM> sub error_notify MM> { MM> my $ERR_USAGE = "error_notify (e,p,x, \"Message Text\")\n"; MM> foreach (@_) MM> { MM> if(/^e$/) {

Re: Time since midnight

2001-12-05 Thread Flavio Soibelmann Glock
> Can I do this using Date::Manip Yes, I guess :) >is there any other way use Date::Tie; tie %time, 'Date::Tie'; $time{epoch} = 36000; print "$time{hour}:$time{minute}:$time{second}\n"; $time{epoch}++; print "$time{hour}:$time{minute}:$time{second}\n"; $time{epoch}++; print "$time{hour}:$time

"q" as an argument

2001-12-05 Thread Michael McQuarrie
I am defining a sub that takes only specific options: sub error_notify { my $ERR_USAGE = "error_notify (e,p,x, \"Message Text\")\n"; foreach (@_) { if(/^e$/) { push @ERR_OPTS, "email"; } elsif (/^p$/) { push @ERR_OPTS, "page";

Re: Pattern match woos

2001-12-05 Thread Maxim Berlin
Hello Dermot, Wednesday, December 05, 2001, Dermot Paikkos <[EMAIL PROTECTED]> wrote: DP> Hi there, DP> This is both frustrating and embarrassing. I can't capture the DP> following data into a variable. The line I want is: DP> GIAZUC00 DP> I have tried a multitude of Regex, none seems to be w

RE: Pattern match woos

2001-12-05 Thread Sonia Patel
Hello, I'm currently working with using regexp to extract XML: Try this: open(F,"$i"); while (defined( $p = )) { chomp($p); # Change statement if ($p=~ /^(.+?)/){ $code=$1; print $code; } -Original Message- From: Dermot Paikkos [mailt

Re: Need help with workweek to week dates ...

2001-12-05 Thread Flavio Soibelmann Glock
# The program below does that, using RFC2445 rules, # but they are not the weeks you expected. # The output is: # 20020316Z,20020317Z,20020318Z,20020319Z,20020320Z,20020321Z,20020322Z # 20030628Z,20030629Z,20030630Z,20030701Z,20030702Z,20030703Z,20030704Z # 20040904Z,20040905Z,20040906Z,20040907Z

Pattern match woos

2001-12-05 Thread Dermot Paikkos
Hi there, This is both frustrating and embarrassing. I can't capture the following data into a variable. The line I want is: GIAZUC00 I have tried a multitude of Regex, none seems to be working. Here's my last attempt: open(F,"$i"); while (defined( $p = )) { chomp($p); ($co

Re[2]: Simpler....

2001-12-05 Thread Maxim Berlin
Hello Sandeep, Wednesday, December 05, 2001, Shinagare, Sandeep <[EMAIL PROTECTED]> wrote: SS> Hi All, SS> I am trying to learn Perl and want to begin with getting an interpreter for SS> the Windows OS (NT). SS> Which are the good ones around for download? http://www.perl.com/pub/a/language/inf

perl and mapbasic

2001-12-05 Thread Ben Crane
Hello... can anyone help? Can (and if so, how) you use perl and mapbasic together? how do you imbed perl into mapbasic and vice versa? any assistance would be kool! Ben __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://sho

Re: Does Perl have an equivalent of C's #include

2001-12-05 Thread Maxim Berlin
Hello Andrew, Wednesday, December 05, 2001, Andrew Clark <[EMAIL PROTECTED]> wrote: AC> The subject says it all. AC> R, AC> AJFC AC> Please CC replys, I'm not on the list. perldoc -f require perldoc -f use Best wishes, Maximmailto:[EMAIL PROTECTED] -- To uns

RE: Simpler....

2001-12-05 Thread Shinagare, Sandeep
Hi All, I am trying to learn Perl and want to begin with getting an interpreter for the Windows OS (NT). Which are the good ones around for download? Also, any pointers for basic tutorials? Thanks a lot. Sandeep -Original Message- From: Maxim Berlin [mailto:[EMAIL PROTECTED]] Sent: 05 De

Re: Simpler....

2001-12-05 Thread Maxim Berlin
Hello Daniel, Wednesday, December 05, 2001, Daniel Falkenberg <[EMAIL PROTECTED]> wrote: DF> Please don't stree to much over this one but, is there an easier way of DF> writing this? DF> while(1){ DF> if ($status == 1) { DF> #Do this sub... DF> sub(); DF> elsif ($status == 1) { DF>

Re: Time since midnight.

2001-12-05 Thread Tirthankar C. Patnaik
> No need for Date::Manip or anything: > > > $timestamp = 36059; > $time = sprintf '%02d:%02d:%02d', > $timestamp / 3600, ($timestamp/60) % 60, $timestamp % 60; Jeez, that is exactly how it should be! I overlooked the obvious in search of the exotic. Thanks, -tir On Wed, 5 Dec 2001

Re: HowTo prevent CPAN upgrading perl.

2001-12-05 Thread Daniel Gardner
GS> In the past, if I've let CPAN install a bundle for just about anything, it's GS> also gone and tried to upgrade perl first which to put it bluntly shafts my GS> box. I would like to avoid this while still making use of CPAN. i believe that newer versions of the CPAN module don't have this "

Re: Time since midnight.

2001-12-05 Thread Jenda Krynicky
From: "Tirthankar C. Patnaik" <[EMAIL PROTECTED]> > I have a set of timestamps, which are seconds since midnight. > > say, 36000 > 36001 > 36002 > . > > I'd like to convert them into the format: > > 10:00:00 > 10:00:01 > . > > Can I do this us

Re: Does Perl have an equivalent of C's #include

2001-12-05 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > Yeah. Use ->is the directive to include packages ! > > like ex:- > > Use Net::CMD; Of course with lowercase "U" and also "MD" : use Net::Cmd; Perl is case sensitive even in the names of modules. Even though it might not seem to be so o

Re: Time since midnight.

2001-12-05 Thread Tirthankar C. Patnaik
> $ perl -le'use Time::Local; > my $time = timelocal(0,0,0,5,11,101); > print scalar localtime($time); > print scalar localtime($time + 36_000); > ' > Wed Dec 5 00:00:00 2001 > Wed Dec 5 10:00:00 2001 > > Thanks a lot. -tir On Wed, 5 Dec 2001, John W. Krahn wrote: > "Tirthankar C. Patnai

Re: Time since midnight.

2001-12-05 Thread John W. Krahn
"Tirthankar C. Patnaik" wrote: > > I have a set of timestamps, which are seconds since midnight. > > say, 36000 > 36001 > 36002 > . > > I'd like to convert them into the format: > > 10:00:00 > 10:00:01 > . > > Can I do this using Date::Manip, failing, which, is

HowTo prevent CPAN upgrading perl.

2001-12-05 Thread Gary Stainburn
Hi all, I'm trying to install RT2 - perl helpdesk suite, but it depends on a load of modules which it will automaticall install using CPAN (I believe) as part of the install script. Is it possible to tell CPAN *not* to upgrade perl in the progress. In the past, if I've let CPAN install a bund

Re: Help: pattern matching with special characters

2001-12-05 Thread John W. Krahn
Nicole Liu wrote: > > I tried this: > $line = " .\A[0] ( A[0] ) , .\B[0] ( B[0] ) , .\C[0] ( > C[0] ) , .\D[0] ( D[0] ) , "; > > $v = "A[0]"; > > if ($line =~ /$v/) { print "got\n"; } if ($line =~ /\Q$v/) { print "got\n"; } perldoc -f quotemeta John -- use Perl; program fulfillment -- To

Re: Printing continuously on a single line

2001-12-05 Thread John W. Krahn
Joe Slaven wrote: > > I have a time /date routine which displays time to the nearest second. Can > anyone advise on how I can loop the sprint statement so that it appears on > the same line each time, but with the seconds ticking over ie., only one > line of display shows while the loop runs, ra

  1   2   >