how to get and convert time

2004-09-17 Thread Franklin
Hello: My operating system is freebsd and its time is GMT time which I can't change. How can I write a perl script to get the exact time(Hour,minute,second) and change it to US ET? Thank you very much! Franklin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Moving between hashes.

2004-09-17 Thread Michael S. Robeson II
I have two sets of data that have been stored in hashes. The first hash has amino-acid (protein) sequence data. The second hash has the corresponding DNA sequence of those amino-acids: Hash 1 key:value: cat = mfgdhf doq = mfg--f mouse = mf-d-f Hash 2 key:

command line option with -ne to print newline

2004-09-17 Thread Ramprasad A Padmanabhan
Quick question, I want to run perl -ane '/REMARKS/ && print $F[1]' FILE1 FILE2 the problem is that there is no newline at the end of the every print. so I have to do perl -ane '/REMARKS/ && print $F[1] . "\n"' FILE1 FILE2 I thought there is a switch in perl by which I could auto pr

Taint mode in Windows (U)

2004-09-17 Thread Meidling, Keith, CTR, ISD
UNCLASSIFIED I seem to recall that the shebang line is generally ignored in Windows, except if you are using it with apache... Please correct me if I'm wrong here... Now, if that is so, is there a way to turn on taint ( -T at end of shebang line) for perl scripts in Windows if the line is ignore

Re: command line option with -ne to print newline

2004-09-17 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: Quick question, I want to run perl -ane '/REMARKS/ && print $F[1]' FILE1 FILE2 the problem is that there is no newline at the end of the every print. so I have to do perl -ane '/REMARKS/ && print $F[1] . "\n"' FILE1 FILE2 I thought there is a switch in

Need Help regarding training centres in INDIA

2004-09-17 Thread Anish Kumar K.
Hi This is regarding PERL training centres in INDIA. Please let me know about this. Thanks Anish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to get and convert time

2004-09-17 Thread John W. Krahn
Franklin wrote: Hello: Hello, My operating system is freebsd and its time is GMT time which I can't change. How can I write a perl script to get the exact time(Hour,minute,second) and change it to US ET? All Unix systems (AFAIK) run on UTC (GMT for you old timers, Zulu Time for you military types)

RE: insert data with Perl into multiple MySQL tables

2004-09-17 Thread Bob Showalter
Maxipoint Rep Office wrote: > How insert data with Perl into multiple MySQL tables? You need multiple INSERT statements. Use a transaction if they all need to complete or fail together. I don't use MySQL, so I don't know how transactions work for it specifically, but typically you just use a combi

Re: Moving between hashes.

2004-09-17 Thread Gunnar Hjalmarsson
Michael S. Robeson II wrote: I have two sets of data that have been stored in hashes. The first hash has amino-acid (protein) sequence data. The second hash has the corresponding DNA sequence of those amino-acids: Hash 1 key:value: cat = mfgdhf doq = mfg--f mouse = mf-d-f Hash

RE: failure with: system("dir /b"); exec("dir /b"); `dir /b`

2004-09-17 Thread Bob Showalter
A B C wrote: > Greetings, > > Does anyone know how to get perl to run windows > commands like "dir /b". Specifically, perl doesn't > accept any type of argument switches. I've tried > system(), exec() and backticks in my script. > > However, If I remove the switch, for example: > system("dir"). T

RE: how to get and convert time

2004-09-17 Thread Bob Showalter
Franklin wrote: > Hello: > My operating system is freebsd and its time is GMT time which I can't > change. How can I write a perl script to get the exact > time(Hour,minute,second) and change it to US ET? As John said, the internal clock is always UTC. On FreeBSD, you use the tzsetup(8) program to

Re: Taint mode in Windows (U)

2004-09-17 Thread Gunnar Hjalmarsson
Keith wrote: I seem to recall that the shebang line is generally ignored in Windows, Even if the path to perl is, the flags are not. (Disclaimer: There may be exceptions...) Now, if that is so, is there a way to turn on taint ( -T at end of shebang line) for perl scripts in Windows Yes: The -T fl

the x operator

2004-09-17 Thread c r
Hi! Is it possible to avoid another loop by using the x operator? I.e. push(@list, rand(4)); gives me one element in @list. Can I somehow use the x operator to produce two different elements in the @list?

Re: the x operator

2004-09-17 Thread Sid
To get $n random numbers into @list, use: @list = (rand(4)) x $n; ~Sid On Fri, 17 Sep 2004 15:02:55 +0200 (CEST), c r <[EMAIL PROTECTED]> wrote: > Hi! > > Is it possible to avoid another loop by using the x operator? I.e. > > push(@list, rand(4)); > > gives me one element in @list. > > Can

Re: the x operator

2004-09-17 Thread Sid
To get $n random numbers into @list, use: @list = (rand(4)) x $n; ~Sid On Fri, 17 Sep 2004 15:02:55 +0200 (CEST), c r <[EMAIL PROTECTED]> wrote: > Hi! > > Is it possible to avoid another loop by using the x operator? I.e. > > push(@list, rand(4)); > > gives me one element in @list. > > Can

Re: the x operator

2004-09-17 Thread Jenda Krynicky
From: Sid <[EMAIL PROTECTED]> > To get $n random numbers into @list, use: > > @list = (rand(4)) x $n; > > ~Sid Nope. This way you get $n times the same random number. Try: print join(', ', (rand(4)) x 5); You need to do something like this: @list = map rand(4), (1..$n); or

Re: Net ::FTP and subroutine calls

2004-09-17 Thread DBSMITH
Right thanks forgot about that! So how do I out this failed info to STDOUT (ftplog), b/c if it does fail I would want to know! As far as the $^ I variable, yes I have tried just opening the files and reading and writing from them! Thanks for the tips and I am still GREEN ! :) What could be

Re: $ ^ I in place editor

2004-09-17 Thread DBSMITH
ok sorry... must of missed that about the in place editor and is restrictions ! Please ignore that last part of my last email! [EMAIL PROTECTED] (Peter Scott) Sent by: [EMAIL PROTECTED] (Peter Scott) 09/16/2004 06:14 PM Please respond to Peter To: [EMAIL PROTECTED] c

Re: $ ^ I in place editor

2004-09-17 Thread DBSMITH
ok so $^ I is only for the diamond operator. Understood. So for situations when not using the diamond operator, $^ I for making backup copies is useless, so thr rename function will have to suffice. Is this the best way? thanks, [EMAIL PROTECTED] (Peter Scott) Sent by: [EMAIL PROTECTED

Re: HoH not building as expected

2004-09-17 Thread Wiggins d Anconia
> > - Original Message - > From: "Wiggins d Anconia" <[EMAIL PROTECTED]> > To: "Mark Goland" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, September 16, 2004 1:27 PM > Subject: Re: HoH not building as expected > > > > > > > > > > > > > > > > I expact the output to be > >

cp command error check

2004-09-17 Thread Urs Wagner
Hello This does not work. `cp $srcfile $dstfile`; || do { print "cannot copy $srcfile to $dstfile"; }; do is also execute if cp working fine. Whz is this so? The next thing I would like to know how I can print the cp's error message. Thanks Urs -- To unsubscribe, e-mail: [EMAIL PROTEC

Re: cp command error check

2004-09-17 Thread Wiggins d Anconia
> Hello > > This does not work. > > `cp $srcfile $dstfile`; || do { > print "cannot copy $srcfile to $dstfile"; > }; > > do is also execute if cp working fine. Whz is this so? The next thing I > would like to > know how I can print the cp's error message. > > Thanks > > Urs Th

Re: cp command error check

2004-09-17 Thread u235sentinel
I believe you want to print $!. Give it a try. > Hello > > This does not work. > > `cp $srcfile $dstfile`; || do { > print "cannot copy $srcfile to $dstfile"; > }; > > do is also execute if cp working fine. Whz is this so? The next thing I > would like to > know how I can prin

Re: Net ::FTP and subroutine calls

2004-09-17 Thread Chris Devers
On Fri, 17 Sep 2004 [EMAIL PROTECTED] wrote: > Right thanks forgot about that! So how do I out this failed info to > STDOUT (ftplog), b/c if it does fail I would want to know! First things first: does the version I sent yesterday work? Focus on getting the FTP transaction to finish properl

Re: Net ::FTP and subroutine calls

2004-09-17 Thread DBSMITH
yes my ftp code has always worked, so lets move on! thanks, Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 Chris Devers <[EMAIL PROTECTED]> 09/17/2004 11:14 AM Please respond to Perl Beginners List To: [EMAIL PROTECTED] cc: Perl Beginners List <[

Re: Net ::FTP and subroutine calls

2004-09-17 Thread Chris Devers
On Fri, 17 Sep 2004 [EMAIL PROTECTED] wrote: > yes my ftp code has always worked, so lets move on! Ok -- you didn't actually say that, you just said things don't work. The way you're using the die statement won't work. Go back to the docs and usual manuals to look for other ways to do this. Th

Re: $ ^ I in place editor

2004-09-17 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: >ok so $^ I is only for the diamond operator. Understood. So for >situations when not using the diamond operator, $^ I for making backup >copies is useless, so thr rename function will have to suffice. > >Is this the best way? Usually

Re: HoH not building as expected

2004-09-17 Thread mgoland
- Original Message - From: Wiggins d Anconia <[EMAIL PROTECTED]> Date: Friday, September 17, 2004 10:20 am Subject: Re: HoH not building as expected > > > > > > - Original Message - > > From: "Wiggins d Anconia" <[EMAIL PROTECTED]> > > To: "Mark Goland" <[EMAIL PROTECTED]>; <

Re: HoH not building as expected

2004-09-17 Thread Wiggins d Anconia
> > > > Though the use of C<$current> could be avoided if you could read > > multiple lines at a time, if that is possible I would switch to that > > method. If not the above should do. > > > > If you are confused or this doesn't work, give it another shot and > > provide at least 10 entries of

Re: the x operator

2004-09-17 Thread Randal L. Schwartz
> "Sid" == Sid <[EMAIL PROTECTED]> writes: Sid> To get $n random numbers into @list, use: Sid> @list = (rand(4)) x $n; You mean, to get the same random number $n times into a list, correct? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> h

Re: cp command error check

2004-09-17 Thread John W. Krahn
Urs Wagner wrote: Hello Hello, This does not work. `cp $srcfile $dstfile`; || do { print "cannot copy $srcfile to $dstfile"; }; do is also execute if cp working fine. Whz is this so? The next thing I would like to know how I can print the cp's error message. use File::Copy; copy( $srcf

Moving between hashes 2.

2004-09-17 Thread Michael Robeson
**Sorry, if this is a repeat. Wasn't sure if the mail went through. If you already replied can you re-send it to my e-mail address above as well? Thanks!*** I have two sets of data that have been stored in hashes. The first hash has amino-acid (protein) sequence data. The second hash has the c

RE: Moving between hashes 2.

2004-09-17 Thread Bob Showalter
Michael Robeson wrote: Don't post MIME or HTML to the list. Plain text only. > > I have two sets of data that have been stored in hashes. The first > hash > has amino-acid (protein) sequence data. The second hash has the > corresponding DNA sequence of those amino-acids: > > > Hash 1 > key: v

RE: failure with: system("dir /b"); exec("dir /b"); `dir /b`

2004-09-17 Thread A B C
Hi, I'm using ActiveState v5.8.4 on Windows XP Home03. Here is the entire script... print `dir /s`; print "\n-\n"; system('dir /b'); print "\n-\n"; exec("dir /w"); print "\n-\n"; === Here is the result after executing... C:\~p>perl test.pl dir: /s: No such file or d

RE: failure with: system("dir /b"); exec("dir /b"); `dir /b`

2004-09-17 Thread Bakken, Luke
> I'm using ActiveState v5.8.4 on Windows XP Home03. > > Here is the entire script... > print `dir /s`; > print "\n-\n"; > system('dir /b'); > print "\n-\n"; > exec("dir /w"); > print "\n-\n"; Since dir is a built-in, you should do this: use strict; print qx!cmd /c dir /s!; print "

Re: Moving between hashes 2.

2004-09-17 Thread Gunnar Hjalmarsson
Michael Robeson wrote: **Sorry, if this is a repeat. Wasn't sure if the mail went through. If you already replied can you re-send it to my e-mail address above as well? Thanks!*** Aren't you subscribed to the list? And if there is a problem with your receiving of email, how about checking the list

Re: Moving between hashes 2.

2004-09-17 Thread Gunnar Hjalmarsson
Bob Showalter wrote: while () { my ($key, $mask, $src) = split; my @mask = $mask =~ /./g; my @src = $src =~ /.../g; print "$key: "; print $_ eq '-' ? '---' : shift @src for @mask; print "\n"; } __DATA__ cat mfgdhf agtcatgcacactgatcg

RE: failure with: system("dir /b"); exec("dir /b"); `dir /b`

2004-09-17 Thread A B C
Luke, Thanks! Your code works, you are a fantastic help. I've been surfing (and surfing and surfing) google for hours trying to find the answer. Your code works and now my testing can proceed :-) -Mark --- "Bakken, Luke" <[EMAIL PROTECTED]> wrote: > > I'm using ActiveState v5.8.4 on Windows XP

Re: Net ::FTP and subroutine calls

2004-09-17 Thread Colegate Spinks
OhioHealth.com> writes: ..snip.. I'm fairly new to Perl, but have been working on a similar typ problem and monitoring the success of my Net::FTP session. I used logic similarm to the following: my ftp; if($ftp = Net::FTP->new($remotehost)) { print "Initial FTP successful\n"; } else { p

Re: how to get and convert time

2004-09-17 Thread Franklin
Thank you very much. The problem is: My perl program will run on a hosting virtual server and the system admin won't allow me to do so. So I must write a perl script to get the computer's GMT time and convert it to US ET.:( On Fri, 17 Sep 2004 08:28:33 -0400, Bob Showalter <[EMAIL PROTECTED]> wro

compare the content of a hash

2004-09-17 Thread Budi Santosa
Hi All, I have a problem like this. Suppose I access a web and save the head line new and summary of this web as a hash. For the next access to the same web, before saving the news I have to check if the same news already in my database.What is the best way to compare our databasse and the most rec

Re: Need Help regarding training centres in INDIA

2004-09-17 Thread Ishwor
On Fri, 17 Sep 2004 17:18:10 +0530, Anish Kumar K. <[EMAIL PROTECTED]> wrote: > Hi > > This is regarding PERL training centres in INDIA. Please let me know about > this. Don't know about any Perl Training Centres in india but theres a nice thing called "books". U can grab one called "Learning Pe

Re: compare the content of a hash

2004-09-17 Thread Edward WIJAYA
perldoc -q hash compare On Fri, 17 Sep 2004 10:20:14 -0700 (PDT), Budi Santosa <[EMAIL PROTECTED]> wrote: Hi All, I have a problem like this. Suppose I access a web and save the head line new and summary of this web as a hash. For the next access to the same web, before saving the news I have to