RE: Confused by a complex data structure

2002-12-14 Thread Beau E. Cox
Hi - Tell perl it really is an array: push @( $trainsList{$trainDate} }, $trainRef; ^^ ^ Aloha => Beau. -Original Message- From: Rob Richardson [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 3:35 PM To: [EMAIL PROTECTED] Subject: Confused b

Re: Archive::Tar problems....

2002-12-14 Thread Dr. Poo
Well... here's an update I've found that it's actually the $tar->write() calls that are slowing the whole operation down... I'm guessing the write actually writes then reads the tar again...which as it grows in size, it will take longer and more cpu resources to read it EACH time... Which

Archive::Tar problems....

2002-12-14 Thread Dr. Poo
My name is Chris, HI! I'm working on a backup application... and i'm using your Archive::Tar perl module (version .22). My question to you is, how can i "flush" the in memory archive after it has reached a certain condition...say like a certain size. My problem is this.

Confused by a complex data structure

2002-12-14 Thread Rob Richardson
Greetings! 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 people who will be working on the train (or

Re: Why does this code fail?

2002-12-14 Thread John W. Krahn
Satya Devarakonda wrote: > > Can somebody tell what is wrong with this. > > I tried single quote (') in place of double quote(") neither of them work. > > for ($i = 0; $i < @clm_types; $i++) > { > @temp_str = grep (/$_/,@env_desc); What are you trying to grep here? What you have is the sam

Re: UNIX Admin and Shell Perl resources

2002-12-14 Thread Jerry Rocteur
Thanks to all of you who answered. I had a lot of fun reading though the links and information sent to me!! I appreciate it!! Jerry Jerry Rocteur wrote: Hi, I like this list very much and I think it is very helpful! In my work and at home I spend most of my time at a UNIX prompt, either Linu

RE: Why does this code fail? - Sorry here are the line numbers..

2002-12-14 Thread Satya_Devarakonda
Thank you - the / was the problem... Satya Devarakonda IS - EDI Tufts Health Plan Tel: 617-923-5587 X 3413 Fax: 617-923- "Wag

RE: Why does this code fail? - Sorry here are the line numbers..

2002-12-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Unsure of what you trying to do? What are you expecting? The separator for join is just a value and by trying / you are looking at it like a split. What does your input look like? What is your output expected? Sorry, but unsure what you are really trying to do. Wags ;) --

Why does this code fail? - Sorry here are the line numbers..

2002-12-14 Thread Satya_Devarakonda
Can somebody tell what is wrong with this. I tried single quote (') in place of double quote(") neither of them work. 184 for ($i = 0; $i < @clm_types; $i++) 185 { 186@temp_str = grep (/$_/,@env_desc); 187@fields = split (/,/,$temp_str[@temp_str - 1],4); 188$env_final[$i] = join (/","

Why does this code fail?

2002-12-14 Thread Satya_Devarakonda
Can somebody tell what is wrong with this. I tried single quote (') in place of double quote(") neither of them work. for ($i = 0; $i < @clm_types; $i++) { @temp_str = grep (/$_/,@env_desc); @fields = split (/,/,$temp_str[@temp_str - 1],4); $env_final[$i] = join (/","/,$fields[1],$fie

Re: Net::SFTP causes script to exit if connection can't be made

2002-12-14 Thread zentara
On Fri, 13 Dec 2002 11:10:54 -0500, [EMAIL PROTECTED] (Ian Zapczynski) wrote: >Unfortunately, using the || as below doesn't change the behavior. Once >my script tries to make the connection and can't, it exists with a >"connection failed to $host, etc. etc." message, whether I use warnings >or

Re: perl script to convert dos newlines to unix newlines...

2002-12-14 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: > > I had written a small script for my own use which gets rid of \r and > also all weird chars inserted by dos ( or windoze ) in plain text files > Do not use it on files which are not plain text > > #!/usr/bin/perl > # > # This file is used to clean the special ch

Re: Execute perl program without seeing the code?

2002-12-14 Thread zentara
On Fri, 13 Dec 2002 10:03:06 -0500, [EMAIL PROTECTED] (Bob Showalter) wrote: >> -Original Message- >> From: Dennis HO Siu-chung [mailto:[EMAIL PROTECTED]] >> Sent: Friday, December 13, 2002 4:01 AM >> To: [EMAIL PROTECTED] >> Subject: Execute perl program without seeing the code? >> >> >

Re: passing a file handle as a sub arg...?

2002-12-14 Thread John W. Krahn
Christopher J Bottaro wrote: > > hello, Hello, > i want to make a sub that is to be used like this: > my @array; > open(INFILE, "blah"); > ParseOneItem (INFILE, \@array); > > i know how to pass the array reference, but how do i pass the file handle? > can i do it just like that? If you have Pe

Re: passing a file handle as a sub arg...?

2002-12-14 Thread Gary Stainburn
On Saturday 14 Dec 2002 6:22 am, christopher j bottaro wrote: > hello, > i want to make a sub that is to be used like this: > my @array; > open(INFILE, "blah"); > ParseOneItem (INFILE, \@array); > > i know how to pass the array reference, but how do i pass the file handle? > can i do it just like t

Re: file handle as a sub arg in perl

2002-12-14 Thread christopher j bottaro
nm, figured it out. you can pass open a scalar like this: open($myfile, "blah"); ParseOneItem($myfile); and use it in the sub like this: sub ParseOneItem() { my $fh = shift(); my $line = <$fh>; } =) -- christopher On Saturday 14 December 2002 03:10 am, christopher j botta

Re: [mail_lists] Re: perl script to convert dos newlines to unix newlines...

2002-12-14 Thread Gary Stainburn
On Saturday 14 Dec 2002 8:51 am, christopher j bottaro wrote: > yes...thank you. i was going to post exactly that, but didn't know how to > phrase it. i'm very capable of producing a script/program in whatever > language that reads a line from input, edits the line, then writes the > edited line

Re: [mail_lists] perl script to convert dos newlines to unix newlines...

2002-12-14 Thread Paul Johnson
On Sat, Dec 14, 2002 at 03:56:04AM -0500, Jim wrote: > perl -p -i -e 's/\r\n/\n/g' file_to_remove_those_pesky_^Ms_from > > Perl one-liners rule. :) This will do it without making the second file. That depends on what you mean by "without making the second file". If the goal is to never have th

Re: [mail_lists] Re: perl script to convert dos newlines to unix newlines...

2002-12-14 Thread christopher j bottaro
yes...thank you. i was going to post exactly that, but didn't know how to phrase it. i'm very capable of producing a script/program in whatever language that reads a line from input, edits the line, then writes the edited line to a new file (or stdout or whatever). but like Jim said, the ques

[Fwd: [mail_lists] Howto do search and replace on all elements of an array .]

2002-12-14 Thread harish
--- Begin Message --- my @arr = ( Directory/obj1.o Directory/obj2.o Directory/obj3.0); In this arry how to search and replace Directory/ so that we can get a array of all objects without their full path. Thanks hari --- End Message --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: [mail_lists] Re: perl script to convert dos newlines to unix newlines...

2002-12-14 Thread Jim
On Friday 13 December 2002 12:18, Gary Stainburn wrote: This still doesn't answer his question. He doesn't want to take up 20 Mb's of hdd space trying to do the edit. :) btw, in a regex \r\n works fine. :) - Jim | On Friday 13 Dec 2002 10:42 am, christopher j bottaro wrote: | > hey, | > i wan

Re: [mail_lists] perl script to convert dos newlines to unix newlines...

2002-12-14 Thread Jim
On Friday 13 December 2002 05:42, you wrote: on the command line do this: perl -p -i -e 's/\r\n/\n/g' file_to_remove_those_pesky_^Ms_from Perl one-liners rule. :) This will do it without making the second file. - Jim | hey, | i wanna make a perl script that will convert those stupid "\r\n" d