Problem with STDOUT redirect

2006-01-22 Thread John Maverick
I am trying to write a wrapper to invoke a script which takes input from STDIN. I am opening a filehandle so that I can store all information returned by invoked script. However, it hangs when second script is waiting for user input. Input varies from time to time. So, I can't use open(SCRIPT,

Re: Array problem

2006-01-22 Thread John Doe
Andrej Kastrin am Montag, 23. Januar 2006 07.55: > I wrote simple script, which have to concatenate multiple lines into > array and then print each element of tihis array: > > I don't know where is the problem, Please, help! The basic problem is that you try to print the result within the (while)

Re: Array problem

2006-01-22 Thread Mazhar
Mr Andrej, I think the following code will work for u, open INPUT,"<$ARGV[0]"; while (){ @array=$_; } foreach $i(@array){ print $i; } Regards Mazhar On 1/23/06, Thomas Bätzler <[EMAIL PROTECTED]> wrote: > > Andrej Kastrin <[EMAIL PROTECTED]> asked: > > I wrote simple script, which have

RE: Array problem

2006-01-22 Thread Thomas Bätzler
Andrej Kastrin <[EMAIL PROTECTED]> asked: > I wrote simple script, which have to concatenate multiple > lines into array and then print each element of tihis array: > > open INPUT,"<$ARGV[0]"; > while ($line=){ I would instead suggest you use the <> special filehandle. This automagically opens a

Array problem

2006-01-22 Thread Andrej Kastrin
I wrote simple script, which have to concatenate multiple lines into array and then print each element of tihis array: open INPUT,"<$ARGV[0]"; while ($line=){ push (@array,$line); foreach $i(@array){ print $i; } } Input is e.g. line 1 line 2 I don't know where is the problem, Pl

Re: import modules at begin block

2006-01-22 Thread Xavier Noria
On Jan 23, 2006, at 2:20, Ken Perl wrote: Hi, May I import all modules located in a directory called '/opt/myperlmodules' in Begin block like this? $myModules = "/opt/myperlmodules"; lib->import($myModules); You want to load them, or to let use() be able to find them? The solution to the fo

import modules at begin block

2006-01-22 Thread Ken Perl
Hi, May I import all modules located in a directory called '/opt/myperlmodules' in Begin block like this? $myModules = "/opt/myperlmodules"; lib->import($myModules); -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

Re: File Parsing

2006-01-22 Thread John Doe
William Black am Sonntag, 22. Januar 2006 15.33: > Hello, > > I'm reading from a file. I'm trying to read in five lines at a time where > each line has a newline and then process the lines into separare variables. > For example, > > Input File > - > Stevens, > Craig A Triangle Family C

Re: File Parsing Question

2006-01-22 Thread Shawn Corey
William Black wrote: Hello, I'm trying to figure out how to read multiple lines from a file at once for parsing. For example,, If the file contained the following: input file Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 I want to read in lines 1-4 for processing then d

Re: File Parsing

2006-01-22 Thread JupiterHost.Net
William Black wrote: Hello, Hello William, I'm reading from a file. I'm trying to read in five lines at a time where each line has a newline and then process the lines into separare variables. For example, Input File - Stevens, Craig A Triangle Family Care PA 106-A Ridgeview

re: File Parsing

2006-01-22 Thread William Black
Hello, I'm reading from a file. I'm trying to read in five lines at a time where each line has a newline and then process the lines into separare variables. For example, Input File - Stevens, Craig A Triangle Family Care PA 106-A Ridgeview Dr Cary, NC View Profile & Phone | Appointme

re: File Parsing Question

2006-01-22 Thread William Black
Hello, I'm trying to figure out how to read multiple lines from a file at once for parsing. For example,, If the file contained the following: input file Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 I want to read in lines 1-4 for processing then during the next iteratio

Re: pack/unpack question

2006-01-22 Thread Beau E. Cox
Thanks - my stupid error. On Sunday 22 January 2006 12:58 am, Xavier Noria wrote: > Beau E. Cox wrote: > > I really thought I understood pack/unpack, > > but this has me stumped. I can't find anything to > > explain the operation of the following script > > in the documentation: > > > > use

Re: pack/unpack question

2006-01-22 Thread Xavier Noria
Beau E. Cox wrote: > I really thought I understood pack/unpack, > but this has me stumped. I can't find anything to > explain the operation of the following script > in the documentation: > > use strict; > use warnings; > > my $buffer = pack( "NN", 22, 0 ); > printf "buffer length = %s\n", length

pack/unpack question

2006-01-22 Thread Beau E. Cox
Hi - I really thought I understood pack/unpack, but this has me stumped. I can't find anything to explain the operation of the following script in the documentation: use strict; use warnings; my $buffer = pack( "NN", 22, 0 ); printf "buffer length = %s\n", length $buffer; print "buffer ", j