Re: Opening .dat file in perl

2006-10-21 Thread Tommy Nordgren
On 20 okt 2006, at 21.31, Goke Aruna wrote: On 10/20/06, John W. Krahn <[EMAIL PROTECTED]> wrote: Goksie wrote: > Thanks all for the past help > > Can someone advice me on how i can open .dat file in perl script? open my $fh, '<', '00016367.DAT' or die "Cannot open '00016367.DAT' $!";

Re: calling system

2006-10-21 Thread Andrew tanenbaum
On Sat, 21 Oct 2006 04:15:23 -0400 (EDT) , Jeff Pang <[EMAIL PROTECTED]> wrote: > >>... >>cont = 0; $cont = 0; >>while () { >>cont++ $cont++ ; >>$file_out = $_; >>$file_in = $cont; >>system "mv $file_in $file_out";} >>... > Isn't the right way? __

whiling through an array

2006-10-21 Thread Kathryn Bushley
Hello again, Thanks Tom Pheonix...I had put in a forward in place of backwards slash...always a stupid mistake...one more question...I am able to substitute the first value in my hash %id_global but doesn't substitute the rest I think because it is only moving through the file once...I've succe

Re: To shebang or not to, and script feedback.

2006-10-21 Thread John W. Krahn
Shawn Milochik wrote: > Hello all. Hello, > I've been spending too much money lately on Amazon buying > Perl books. Recently, I've been playing with scripts downloaded from > the Web site of a book I'm going through. For some reason, some of the > .pl files have a shebang, and others do not. >

Re: calling system

2006-10-21 Thread xavier mas
A Dissabte 21 Octubre 2006 11:18, Xavier Noria va escriure: > On Oct 21, 2006, at 9:52 AM, xavier mas wrote: > > Dear all, > > Hi Xavier! > > > I'm trying to rename a bunch of files to the estination names > > included in a > > prepared files calling the system function "mv" inside a while loop > >

Re: To shebang or not to, and script feedback.

2006-10-21 Thread xavier mas
A Dissabte 21 Octubre 2006 10:31, Shawn Milochik va escriure: > Hello all. I've been spending too much money lately on Amazon buying > Perl books. Recently, I've been playing with scripts downloaded from > the Web site of a book I'm going through. For some reason, some of > the .pl files have a she

Re: calling system

2006-10-21 Thread Xavier Noria
On Oct 21, 2006, at 9:52 AM, xavier mas wrote: Dear all, Hi Xavier! I'm trying to rename a bunch of files to the estination names included in a prepared files calling the system function "mv" inside a while loop (that reads the destination files one by one). But when doing this, I get a

Re: regular expression syntax

2006-10-21 Thread Dr.Ruud
Kathryn Bushley schreef: > #!/usr/bin/perl -w > use warnings; You have both -w and lexical warnings. Read `perldoc perllexwarn` or http://perldoc.perl.org/perllexwarn.html Now first change your two lines to these three: #!/usr/bin/perl use warnings ; use strict ; and see what extra help

To shebang or not to, and script feedback.

2006-10-21 Thread Shawn Milochik
Hello all. I've been spending too much money lately on Amazon buying Perl books. Recently, I've been playing with scripts downloaded from the Web site of a book I'm going through. For some reason, some of the .pl files have a shebang, and others do not. 1. What's the difference, other than

Re: calling system

2006-10-21 Thread Jeff Pang
>... >cont = 0; >while () { >cont++ >$file_out = $_; >$file_in = $cont; >system "mv $file_in $file_out";} >... Hello, I think it's better to use perl's "rename" instead of system call "mv". See 'perldoc -f rename'. -- Books below translated by me to Chinese. Practical mod_perl: http://home.ear

calling system

2006-10-21 Thread xavier mas
Dear all, I'm trying to rename a bunch of files to the estination names included in a prepared files calling the system function "mv" inside a while loop (that reads the destination files one by one). But when doing this, I get an error saying a destiantion operand is missing in line calling t