Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Jim Gibson
At 9:54 AM +0530 1/20/10, Parag Kalra wrote: I didn't get a chance to try on Mac, FreeBSD and Solaris. BTW currently I use Windoze at work place and Ubuntu @ Home. So soon planning buy Macbook Pro. Hence wanted to know your feedback on Perl in Mac. Perl works fine on a Mac. You can use the one

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Randal L. Schwartz
> "Parag" == Parag Kalra writes: Parag> I didn't get a chance to try on Mac, FreeBSD and Solaris. Parag> Also I guess it has nothing to do with OS but how the Parag> shell/terminal/console/CMD interprets the syntax of the one liner. No, because every modern Unixy Perl should interpret that

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Parag Kalra
I didn't get a chance to try on Mac, FreeBSD and Solaris. Also I guess it has nothing to do with OS but how the shell/terminal/console/CMD interprets the syntax of the one liner. Kindly correct me if I am wrong. BTW currently I use Windoze at work place and Ubuntu @ Home. So soon planning buy Ma

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Steve Bertrand
Parag Kalra wrote: > Here it comes - > > perl -e "BEGIN{print 'Birthday '} UNITCHECK{print 'Sweets '} CHECK{print > '@ '} INIT{print 'my '} END{print 'Desk'}" > > Message is different but intention is same - Nasty & Nerdy :) > > Also it works only on Windows :( ...are you sure? On FreeBSD: % p

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Parag Kalra
Here it comes - perl -e "BEGIN{print 'Birthday '} UNITCHECK{print 'Sweets '} CHECK{print '@ '} INIT{print 'my '} END{print 'Desk'}" Message is different but intention is same - Nasty & Nerdy :) Also it works only on Windows :( Cheers, Parag On Wed, Jan 20, 2010 at 7:24 AM, Steve Bertrand w

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Steve Bertrand
Randal L. Schwartz wrote: >> "Steve" == Steve Bertrand writes: > > Steve> Parag Kalra wrote: >>> Yes I found one really nerdy and nasty JAPH. :) > > Steve> ...ensure that you credit the original author, out of respect, if > Steve> anything ;) > > In this case, *he'd* be the original author,

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Randal L. Schwartz
> "Steve" == Steve Bertrand writes: Steve> Parag Kalra wrote: >> Yes I found one really nerdy and nasty JAPH. :) Steve> ...ensure that you credit the original author, out of respect, if Steve> anything ;) In this case, *he'd* be the original author, and the author of the JAPH would just be

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Steve Bertrand
Parag Kalra wrote: > Yes I found one really nerdy and nasty JAPH. :) ...ensure that you credit the original author, out of respect, if anything ;) Steve -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Data file with records that span two lines

2010-01-19 Thread C.DeRykus
On Jan 18, 9:09 pm, perln...@tragic.pointyhats.com (Perl Noob) wrote: > I have a data file with thousands of records.  The problem is that the > records in the data file span two lines for each record.  I want to > write a perl script that makes each record a single line.  The file > looks like thi

Re: Data file with records that span two lines - REVISITED

2010-01-19 Thread Jim Gibson
On 1/19/10 Tue Jan 19, 2010 3:03 PM, "Perl Noob" scribbled: > > The data is not consistent throughout the entire file. I WISH I only > had to skip every other line. The problem is not quite that simple. > The data I need is always consistent within the file, but is not so > neat as to be on

Re: Data file with records that span two lines - REVISITED

2010-01-19 Thread Perl Noob
> On 1/19/2010 12:09 AM, Perl Noob wrote: >> I have a data file with thousands of records. The problem is that >> the >> records in the data file span two lines for each record. I want to >> write a perl script that makes each record a single line. The file >> looks like this: >> >> RECORD1FIELD

Re: Geeky way to wish Happy Birthday through Perl

2010-01-19 Thread Parag Kalra
Yes I found one really nerdy and nasty JAPH. :) Cheers, Parag On Tue, Jan 19, 2010 at 1:33 AM, Randal L. Schwartz wrote: > > "Parag" == Parag Kalra writes: > > Parag> EG: perl -e "print 'Happy Birthday Larry!!!'" > > Parag> But this is very simple and you can directly make out without ev

Re: Searching First Array in Second Array

2010-01-19 Thread Parag Kalra
Jesus Christ - Yes thats the only word I have for Perl. Today I have released how speedy, stable and simple Perl is. Now the reason why I am saying this is because of the same thread I opened at Perlmonks - http://perlmonks.org/?node_id=818166 Just refer the code shared by rkrieger. That algorith

Re: Data file with records that span two lines

2010-01-19 Thread Brad Baxter
On 1/19/2010 12:09 AM, Perl Noob wrote: I have a data file with thousands of records. The problem is that the records in the data file span two lines for each record. I want to write a perl script that makes each record a single line. The file looks like this: RECORD1FIELD1 RECORD1FIELD2

Re: Searching First Array in Second Array

2010-01-19 Thread Shawn H Corey
Parag Kalra wrote: > Hello All, > > I have 2 arrays. I have written a script that searches each and every value > of first array in the second array. Each & every value of Source Array > should occur only once in the target array but it can occur anywhere. > > If any of the source value doesn't o

Re: Data file with records that span two lines

2010-01-19 Thread Perl Noob
> On Tue, Jan 19, 2010 at 08:12:25AM -0500, Perl Noob wrote: >> > 在 2010-01-19二的 00:09 -0500,Perl Noob写道: >> >> I have a data file with thousands of records. The problem is >> that >> >> the >> >> records in the data file span two lines for each record. I want >> to >> >> write a pe

Re: Searching First Array in Second Array

2010-01-19 Thread Chris Charley
- Original Message - From: "Parag Kalra" Sent: Tuesday, January 19, 2010 6:45 AM Subject: Searching First Array in Second Array Hello All, I have 2 arrays. I have written a script that searches each and every value of first array in the second array. Each & every value of Source

Re: Data file with records that span two lines

2010-01-19 Thread John W. Krahn
Perl Noob wrote: I have a data file with thousands of records. The problem is that the records in the data file span two lines for each record. I want to write a perl script that makes each record a single line. The file looks like this: RECORD1FIELD1 RECORD1FIELD2 RECORD1FIELD3 RECORD1

Re: basename question from "learning perl"

2010-01-19 Thread Jim Green
Thank you all! I figured it out! Jim 2010/1/18 Alexander Koenig : > Hi Jim, > > Jim Green wrote on 01/17/2010 05:25 PM: >> my $name = "/usr/local/bin/perl"; >> (my $basename = $name) =~ s#.*/##; # Oops! >> >> after substitution $basename is supposed to be >> perl >> >> but why it is not /local/bin

Re: Data file with records that span two lines

2010-01-19 Thread Paul Johnson
On Tue, Jan 19, 2010 at 08:12:25AM -0500, Perl Noob wrote: > > 在 2010-01-19二的 00:09 -0500,Perl Noob写道: > >> I have a data file with thousands of records. The problem is that > >> the > >> records in the data file span two lines for each record. I want to > >> write a perl script tha

AW: passing a hash via cookie and dereferencing it

2010-01-19 Thread Thomas Bätzler
mike asked: > I am trying to pass a hash of hashes from one script to another via a > cookie. I can get the cookie to pass, but when I try to get the inner > hash keys and values using what I think is the correct method, I > cannot get them. Here are two scripts which should do it, but don't: A

passing a hash via cookie and dereferencing it

2010-01-19 Thread mike
Hello everyone: I am trying to pass a hash of hashes from one script to another via a cookie. I can get the cookie to pass, but when I try to get the inner hash keys and values using what I think is the correct method, I cannot get them. Here are two scripts which should do it, but don't: #1: pr

Re: Data file with records that span two lines

2010-01-19 Thread Perl Noob
> 在 2010-01-19二的 00:09 -0500,Perl Noob写道: >> I have a data file with thousands of records. The problem is that >> the >> records in the data file span two lines for each record. I want to >> write a perl script that makes each record a single line. The file >> looks like this: >> >

Re: Files are getting blank while using substitute command in script

2010-01-19 Thread harish behl
--- On Tue, 19/1/10, Erez Schatz wrote: Hi Erez,   Thanks for your prompt reply. I have made the changes as per your suggestions. like foreach   (@lines)    {  my $fname = basename($filename ); s/$var/\$Header: $fname 120.0 2007\/11\/27 07:59:52 atgops1 noship \$/; print

Re: Searching First Array in Second Array

2010-01-19 Thread Dermot
2010/1/19 Parag Kalra : > Hello All, > > I have 2 arrays. I have written a script that searches each and every value > of first array in the second array. Each & every value of Source Array > should occur only once in the target array but it can occur anywhere. > > If any of the source value doesn'

Searching First Array in Second Array

2010-01-19 Thread Parag Kalra
Hello All, I have 2 arrays. I have written a script that searches each and every value of first array in the second array. Each & every value of Source Array should occur only once in the target array but it can occur anywhere. If any of the source value doesn't occur or occur multiple times then

Re: PERL binary conversion

2010-01-19 Thread Dermot
2010/1/19 Shan : > - Original Message - From: "Dermot" > To: "Perl Beginners" > Sent: Monday, January 18, 2010 5:42 PM > Subject: Re: PERL binary conversion >> 2010/1/18 Shan : >>> >>> Thank u for your quick reply. > > How to install following module.or How to install following mo

Re: Files are getting blank while using substitute command in script

2010-01-19 Thread Erez Schatz
2010/1/19 harish behl : > My Script has to search a particular string like "\$Header\$" in files and if > this string is found, it should replace it with "\$Header > $NameofFile 01/01/2009". But it's making the files blanks. This means you have a problem in the part that is writing to the files,

Files are getting blank while using substitute command in script

2010-01-19 Thread harish behl
Hi All,   I am a newbie to Perl Script. I need your help in one of my perl Script. My Script has to search a particular string like "\$Header\$" in files and if this string is found, it should replace it with "\$Header $NameofFile 01/01/2009". But it's making the files blanks.   Please look at