Re: Reading in a bash function.

2008-08-28 Thread Mr. Shawn H. Corey
On Thu, 2008-08-28 at 19:59 +0200, Laurens Vets wrote: > Hello, > > >> When I log onto a linux host, and use "set" I can see that there a > >> couple of functions defined (test() for instance) in bash. How can I > >> read out these functions and use them in a perl script? > > > > You can't as

Re: Reading in a bash function.

2008-08-28 Thread Laurens Vets
Hello, When I log onto a linux host, and use "set" I can see that there a couple of functions defined (test() for instance) in bash. How can I read out these functions and use them in a perl script? You can't as they are bash functions, not Perl functions. There's no way to read them out l

Re: Reading in a bash function.

2008-08-28 Thread John W. Krahn
Laurens Vets wrote: Hi all, Hello, When I log onto a linux host, and use "set" I can see that there a couple of functions defined (test() for instance) in bash. How can I read out these functions and use them in a perl script? You can't as they are bash functions, not Perl functions. J

Reading in a bash function.

2008-08-28 Thread Laurens Vets
Hi all, When I log onto a linux host, and use "set" I can see that there a couple of functions defined (test() for instance) in bash. How can I read out these functions and use them in a perl script? I've search the archives, but nothing came up. Thanks in advance! -- To unsubscribe, e-mai

Re: reading in a file, line by line by picking certian lines

2008-06-22 Thread Pat Rice
Hi all Thanks for all the help with this, going to have some fun implementing it :) Thanks Pat -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: reading in a file, line by line by picking certian lines

2008-06-21 Thread Brad Baxter
On Jun 20, 1:30 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > Here is another way to do it: > > my $jump; > while ( ) { > $jump = $. + 10 if /regex/; > print "the output" if $jump == $.; > } > Two observations: 1. this will warn while $jump is undef 2. if regex is matched by one o

Re: reading in a file, line by line by picking certian lines

2008-06-20 Thread icarus
> I am looking at a way of reading a line doing a regex to find the > specific line then pick out the line, sudo code would be some thing > like the following: > > read in line > check regex > > if regex is correct > {jump 10 lines > print the output > > } > > any ideas on jumping the 10 li

Re: reading in a file, line by line by picking certian lines

2008-06-20 Thread John W. Krahn
Pat Rice wrote: Hi all Hello, I am looking at a way of reading a line doing a regex to find the specific line then pick out the line, sudo code would be some thing like the following: read in line check regex if regex is correct {jump 10 lines print the output } any ideas on jumpin

Re: reading in a file, line by line by picking certian lines

2008-06-20 Thread David Romero
On Fri, Jun 20, 2008 at 8:06 AM, Pat Rice <[EMAIL PROTECTED]> wrote: > > Hi all > > I am looking at a way of reading a line doing a regex to find the > specific line then pick out the line, sudo code would be some thing > like the following: > > read in line > check regex > > if regex is correct >

Re: reading in a file, line by line by picking certian lines

2008-06-20 Thread Chas. Owens
On Fri, Jun 20, 2008 at 09:06, Pat Rice <[EMAIL PROTECTED]> wrote: > Hi all > > I am looking at a way of reading a line doing a regex to find the > specific line then pick out the line, sudo code would be some thing > like the following: > > read in line > check regex > > if regex is correct > {

reading in a file, line by line by picking certian lines

2008-06-20 Thread Pat Rice
Hi all I am looking at a way of reading a line doing a regex to find the specific line then pick out the line, sudo code would be some thing like the following: read in line check regex if regex is correct {jump 10 lines print the output } any ideas on jumping the 10 lines, how do I ign

Re: Reading in external file, strip out duplicates, sort then save as ext. file

2005-09-21 Thread John W. Krahn
macromedia wrote: > Hi, Hello, > I have a file that I would like to read in then do the following: > > - Read in each line and remove any duplicate text with tags > - Sort the file so all tag IDs are in sequential order > - Save the results to a different file name. > > Can this be done easily?

re: Reading in external file, strip out duplicates, sort then save as ext. file

2005-09-21 Thread Chris Devers
On Wed, 21 Sep 2005, macromedia wrote: > I have a file that I would like to read in then do the following: > > - Read in each line and remove any duplicate text with tags > - Sort the file so all tag IDs are in sequential order > - Save the results to a different file name. > > Can this be done

re: Reading in external file, strip out duplicates, sort then save as ext. file

2005-09-21 Thread macromedia
Hi, I have a file that I would like to read in then do the following: - Read in each line and remove any duplicate text with tags - Sort the file so all tag IDs are in sequential order - Save the results to a different file name. Can this be done easily? If so, how? I'm really a newbie at this

re: Reading in external file, strip out duplicates, sort then save as ext. file

2005-09-21 Thread macromedia
Hi, I have a file that I would like to read in then do the following: - Read in each line and remove any duplicate text with tags - Sort the file so all tag IDs are in sequential order - Save the results to a different file name. Can this be done easily? If so, how? I'm really a newbie at this

Re: make changes to a file, then reading in those changes. . .

2003-10-07 Thread Rob Dixon
Hi Trina. Trina Espinoza wrote: > I have a file that I want to run multiple actions on. First, the file is > read in as one long string. I want to > substitute some words with others so I run a substitution. That seems to > change the data in the first > while, HOWEVER, when I run the second while

Re: make changes to a file, then reading in those changes. . .

2003-10-07 Thread Sudarshan Raghavan
Trina Espinoza wrote: > I have a file that I want to run multiple actions on. First, the file is > read in as one long string. I want to > substitute some words with others so I run a substitution. That seems to > change the data in the first > while, HOWEVER, when I run the second while loop on t

make changes to a file, then reading in those changes. . .

2003-10-06 Thread Trina Espinoza
I have a file that I want to run multiple actions on. First, the file is read in as one long string. I want to substitute some words with others so I run a substitution. That seems to change the data in the first while, HOWEVER, when I run the second while loop on the same data to parse my newly

Re: Reading in...

2002-05-24 Thread drieux
On Friday, May 24, 2002, at 11:21 , Lovett, Clay wrote: > I am having some difficulty with the following: > > I need to read a filename from a directory and assign the path to a > variable > $new so I can issue an open command; > > I also need to loop this and perform encrypt with pgp and the f

Reading in...

2002-05-24 Thread Lovett, Clay
# Begins loop for reading in $new, system (`pgp `);# encrypting to get $pgp ftping $pgp $pgp=$_;# and finally moving $new and $pgp system (`ftp `);

Reading in a data file

2001-07-18 Thread Mark Flynn
I need to read some data from an input file. I have a regex that picks out just numbers from the file, but I can't seem to be able get the ones I want. Here is the code I wrote: open (KA, "K.a") || die #reads file "K.a" "can't open K.a: $!"; LINE: while () { #r

Re: Reading in a loop from a socket?

2001-07-06 Thread Robert Aspinall
t;Robert Aspinall" <[EMAIL PROTECTED]>; "C.J. Collier" <[EMAIL PROTECTED]>; "Robert Aspinall" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, July 06, 2001 3:06 PM Subject: Re: Reading in a loop from a socket? > At 02:54 PM 7/6/01 -0400, Robe

Re: Reading in a loop from a socket?

2001-07-06 Thread Peter Scott
At 02:54 PM 7/6/01 -0400, Robert Aspinall wrote: >This just got odder. Looks like I'm reading the data in just fine, but it >won't print to the screen unless I preface and suffix it with a newline. >Any idea what could cause that? The usual: STDOUT is fully buffered by default. Stick $| = 1;

Re: Reading in a loop from a socket?

2001-07-06 Thread Robert Aspinall
This just got odder. Looks like I'm reading the data in just fine, but it won't print to the screen unless I preface and suffix it with a newline. Any idea what could cause that? Robert Aspinall Support Engineer V-ONE Corporation [EMAIL PROTECTED] > You might consider the following. I am tra

Reading in a loop from a socket?

2001-07-06 Thread Robert Aspinall
Hello, I'm new to the perl beginners list, as of about 5 minutes ago. I'm having problems reading info from a socket. Entire lines (suffixed with a newline character) come through fine, but anytime the server sends a few characters without a newline, I don't recieve it. I can read these charac

Re: regexp?? Reading in multiple lines to search??

2001-05-08 Thread Jeff Pinyan
On May 8, Ga Bu said: >I am fairly new to perl and having problems with >pulling in multiple lines from a file so I can search >those lines and if it has the expression I am looking >for then I want to return to that file and search >again for the same pattern of lines again and then >search agai

Re: regexp?? Reading in multiple lines to search??

2001-05-08 Thread Carl Rogers
Being a beginner myself, this might work, but someone else may have a better solution... $INFILE = "Your_Input_File.txt" ; open (OUTFILE, ">Your_Output_File.txt";) or die; open (INFILE) or die; while ($line = ) { chomp ($line); if ($line =~ /(whatever expression you're looking for)/) {

regexp?? Reading in multiple lines to search??

2001-05-08 Thread Ga Bu
Hi everyone, I am fairly new to perl and having problems with pulling in multiple lines from a file so I can search those lines and if it has the expression I am looking for then I want to return to that file and search again for the same pattern of lines again and then search again for the patt

Re: traversing dir tree and reading in files

2001-05-01 Thread Craig Moynes/Markham/IBM
Bhattacharya"To: <[EMAIL PROTECTED]> Subject: traversing dir tree and reading in files

traversing dir tree and reading in files

2001-05-01 Thread Kaustav Bhattacharya
been trying to work out how to get PERL to traverse a given directory tree looking for all files with the string _boot.js in the file name. then I want to read each file and find all lines which start with the string "sWinReg" and copy them in to an array with each line being places in a seperate