Re: Print to several logs

2013-08-28 Thread Michael Brader
There are some good answers here so far, but I'd like to recommend a logging module like Log::Log4perl. If your script is more than a run-once throwaway, proper logging will almost certainly be of benefit. Metacpan: https://metacpan.org/module/Log::Log4perl FAQ:

Re: Print to several logs

2013-08-28 Thread Harry Putnam
Rob Dixon rob.di...@gmx.com writes: On 27/08/2013 23:06, John W. Krahn wrote: Harry Putnam wrote: [...] (Simplified for discussion, from a longer script) my $rsync = 'rsync'; my $tmplog = 'one.log'; my $tmplog2 = 'two.log'; open(LOG,$tmplog)or die Can't open $tmplog : $!;

Re: Print to several logs

2013-08-28 Thread Shawn H Corey
On Wed, 28 Aug 2013 10:42:30 -0400 Harry Putnam rea...@newsguy.com wrote: Thanks to all other posters.. lots of good input. It seems to me that recording the same information is many places is a design flaw. If you have the same information in two or more places, it will get out of sync. Write

Re: Print to several logs

2013-08-28 Thread Harry Putnam
Shawn H Corey shawnhco...@gmail.com writes: On Wed, 28 Aug 2013 10:42:30 -0400 Harry Putnam rea...@newsguy.com wrote: Thanks to all other posters.. lots of good input. It seems to me that recording the same information is many places is a design flaw. If you have the same information in

Re: Print to several logs

2013-08-28 Thread Shawn H Corey
On Wed, 28 Aug 2013 12:34:40 -0400 Harry Putnam rea...@newsguy.com wrote: That sounds quite a bit like what cron could do with this hmm. Or use a hard link to preserve the file. -- Don't stop where the ink does. Shawn -- To unsubscribe, e-mail:

Re: Print to several logs

2013-08-28 Thread John W. Krahn
Rob Dixon wrote: On 27/08/2013 23:06, John W. Krahn wrote: my %logs = ( 'one.log' = undef, 'two.log' = undef, ); for my $name ( keys %logs ) { open my $FH, '', $name or die Cannot open '$name' because: $!; $logs{ $name } = $FH; } for my $log_FH ( values %logs ) { print $log_FH kdkdkdkd

Re: Print to several logs

2013-08-28 Thread Rob Dixon
On 28/08/2013 19:06, John W. Krahn wrote: Rob Dixon wrote: use strict; use warnings; use autodie; my $rsync = 'rsync'; my $tmplog = 'one.log'; my $tmplog2 = 'two.log'; my %logs = map { open my $FH, '', $_; What if open fails?! I have `use autodie`. Rob -- To unsubscribe, e-mail:

Re: Print to several logs

2013-08-28 Thread Shawn H Corey
On Wed, 28 Aug 2013 12:34:40 -0400 Harry Putnam rea...@newsguy.com wrote: Good thinking thanks. It might not really apply here though. I'm no kind of data manager... just a homeboy hillbilly. What I had in mind is writing to a single log file that is dated on the file name for each run of

Re: Print to several logs

2013-08-27 Thread John W. Krahn
Harry Putnam wrote: I happen to be scripting something that needs to have two logs written to and was sort of taken by how awkward this construction looked: (Simplified for discussion, from a longer script) my $rsync = 'rsync'; my $tmplog = 'one.log'; my $tmplog2 = 'two.log';

Re: Print to several logs

2013-08-27 Thread Nathan Hilterbrand
See reply below, please I happen to be scripting something that needs to have two logs written to and was sort of taken by how awkward this construction looked: (Simplified for discussion, from a longer script) my $rsync = 'rsync'; my $tmplog = 'one.log'; my $tmplog2 = 'two.log';

Re: Print to several logs

2013-08-27 Thread Jim Gibson
On Aug 27, 2013, at 2:14 PM, Harry Putnam wrote: I happen to be scripting something that needs to have two logs written to and was sort of taken by how awkward this construction looked: (snipped) Check out the IO::Tee module from CPAN. I have not used it, but it is mentioned in several

Re: Print to several logs

2013-08-27 Thread Rob Dixon
On 27/08/2013 23:06, John W. Krahn wrote: Harry Putnam wrote: I happen to be scripting something that needs to have two logs written to and was sort of taken by how awkward this construction looked: (Simplified for discussion, from a longer script) my $rsync = 'rsync'; my $tmplog =

Re: Print to several logs

2013-08-27 Thread Nathan Hilterbrand
Jim, *much* better. I did a search for something like that before I wrote what I did, but I guess I didn't get the search terms right, because I didn't find it. Very cool Nathan On Aug 27, 2013, at 2:14 PM, Harry Putnam wrote: I happen to be scripting something that needs to have two

Re: print 2 array elements

2012-09-05 Thread Shlomi Fish
Hi jet speed, On Wed, 5 Sep 2012 11:47:41 +0100 jet speed speedj...@googlemail.com wrote: Hi All, I would like to print array1 with array2 as below ex: output --- abc-12 20/1 def-22 30/22 ghi-33 40/3 def-22 20/1 The best way would be to iterate over the indexes: for my

Re: print 2 array elements

2012-09-05 Thread jet speed
Thanks Sholmi. Appreciate your help !. that's correct, i did make up the syntax, bec's the actual program is in a different system, were i cannot access mail. Cheers Sj On Wed, Sep 5, 2012 at 12:10 PM, Shlomi Fish shlo...@shlomifish.org wrote: Hi jet speed, On Wed, 5 Sep 2012 11:47:41

Re: print 2 array elements

2012-09-05 Thread Dr.Ruud
On 2012-09-05 12:47, jet speed wrote: output --- abc-12 20/1 def-22 30/22 ghi-33 40/3 def-22 20/1 @array1 =abc-12, def-22, ghi-33,abc-12,def-22; @array2 =20/1, 30/22, 40/3, 20/1; i did try to map array1 to array2 elements, did'nt work. %hash = map {$array1[$_] = $array2[$_] }

Re: print output on console at runtime

2011-07-28 Thread Irfan Sayed
, July 13, 2011 12:00 PM Subject: Re: print output on console at runtime You chose to allow Jim Gibson (jimsgib...@gmail.com) even though this message failed authentication Click to disallow

Re: print output on console at runtime

2011-07-28 Thread Irfan Sayed
irfan From: Irfan Sayed irfan_sayed2...@yahoo.com To: Jim Gibson jimsgib...@gmail.com; Perl Beginners beginners@perl.org Sent: Thursday, July 28, 2011 12:06 PM Subject: Re: print output on console at runtime can this be happen if command needs to be executed

Re: print output on console at runtime

2011-07-13 Thread Chandrashekar Bhat
You can use system command inside perl system( find . -iname 'abc'); -- Shekar On Wed, Jul 13, 2011 at 11:16 AM, Irfan Sayed irfan_sayed2...@yahoo.comwrote: hi, i need to print the output of a command on the console at runtime lets say, i need to execute find command .as of now , what i am

Re: print output on console at runtime

2011-07-13 Thread Jim Gibson
At 10:46 PM -0700 7/12/11, Irfan Sayed wrote: hi, i need to print the output of a command on the console at runtime lets say, i need to execute find command .as of now , what i am doing is , @cmd= `find . -name abc`; print @cmd\n; now what happens is, once the command completed then it will

Re: print output on console at runtime

2011-07-13 Thread John W. Krahn
Irfan Sayed wrote: hi, Hello, i need to print the output of a command on the console at runtime lets say, i need to execute find command .as of now , what i am doing is , @cmd= `find . -name abc`; print @cmd\n; now what happens is, once the command completed then it will send entire

Re: print output on console at runtime

2011-07-13 Thread Irfan Sayed
: Wednesday, July 13, 2011 12:00 PM Subject: Re: print output on console at runtime You chose to allow Jim Gibson (jimsgib...@gmail.com) even though this message failed authentication Click to disallow

Re: print output on console at runtime

2011-07-13 Thread Jim Gibson
At 12:27 AM -0700 7/13/11, Irfan Sayed wrote: thanks John and Jim but, is this solution is applicable to only find command ? No. if i change the command to some other system command , will this solution work? Yes. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: print $myhash{key} gets SCALAR(0x1b8db540) instead of 0

2011-02-10 Thread gry
On Feb 9, 8:13 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: On 11-02-09 04:52 PM, gry wrote: [[v5.8.8 built for x86_64-linux-thread-multi] #!/usr/bin/perl -W use Getopt::Long; my $dml = 0; my $iterations = 10; my %options = (dml! =  \$dml,           iterations=i =  

Re: print $myhash{key} gets SCALAR(0x1b8db540) instead of 0

2011-02-10 Thread Rob Dixon
On 09/02/2011 21:52, gry wrote: [[v5.8.8 built for x86_64-linux-thread-multi] #!/usr/bin/perl -W use Getopt::Long; my $dml = 0; my $iterations = 10; my %options = (dml! = \$dml, iterations=i = \$iterations); GetOptions(%options) || die bad options; printf dml=$dml\n; print

Re: print $myhash{key} gets SCALAR(0x1b8db540) instead of 0

2011-02-09 Thread Shawn H Corey
On 11-02-09 04:52 PM, gry wrote: [[v5.8.8 built for x86_64-linux-thread-multi] #!/usr/bin/perl -W use Getopt::Long; my $dml = 0; my $iterations = 10; my %options = (dml! = \$dml, iterations=i = \$iterations); GetOptions(%options) || die bad options; printf dml=$dml\n; print

Re: print $myhash{key} gets SCALAR(0x1b8db540) instead of 0

2011-02-09 Thread John W. Krahn
gry wrote: [[v5.8.8 built for x86_64-linux-thread-multi] #!/usr/bin/perl -W use Getopt::Long; my $dml = 0; my $iterations = 10; my %options = (dml! = \$dml, iterations=i = \$iterations); GetOptions(%options) || die bad options; printf dml=$dml\n; That should be either: print

Re: print map question

2010-11-14 Thread Mike McClain
On Sat, Nov 13, 2010 at 05:43:21AM -0500, Uri Guttman wrote: MM == Mike McClain mike.j...@nethere.com writes: MM Could someone tell me why there is a comma printed after the newline? because you put it there. the \n is input to the map, not the print! map's last arg is a list and it takes

Re: print map question

2010-11-13 Thread Uri Guttman
MM == Mike McClain mike.j...@nethere.com writes: MM mike@/deb40a:~/perl perl -we ' MM @list=qw/Perl is cool./;print( list=\t, map { $_, } @list, \n); MM ' MM list= Perl,is,cool., MM ,mike@/deb40a:~/perl MM Could someone tell me why there is a comma printed after the newline?

Re: Print FH to file.

2010-10-25 Thread KA B
On Oct 23, 6:45 pm, shlo...@iglu.org.il (Shlomi Fish) wrote: Hi KA B, On Friday 22 October 2010 21:12:29 KA B wrote: I`m trying to get the filehandler 1 and 2 to print the result in one line. It's filehandles - not filehandlers. The script i have made makes 2 lines. The script goes

Re: Print FH to file.

2010-10-23 Thread Shlomi Fish
Hi KA B, On Friday 22 October 2010 21:12:29 KA B wrote: I`m trying to get the filehandler 1 and 2 to print the result in one line. It's filehandles - not filehandlers. The script i have made makes 2 lines. The script goes like this: my

Re: print string in file

2010-08-19 Thread Irfan Sayed
Thanks all it worked. --Irfan From: Dr.Ruud rvtol+use...@isolution.nl To: beginners@perl.org Sent: Wed, August 18, 2010 12:35:57 AM Subject: Re: print string in file Irfan Sayed wrote: print MYFILE ?xml version=1.0 encoding=UTF-8?\n where MYFILE is a file

RE: print string in file

2010-08-17 Thread Bob McConnell
From: Irfan Sayed I need to print some string into the file. the string is like this : ?xml version=1.0 encoding=UTF-8? i have written code like this : print MYFILE ?xml version=1.0 encoding=UTF-8?\n where MYFILE is a file handler. if i run this code , it is giving so many syntax

Re: print string in file

2010-08-17 Thread Shawn H Corey
On 10-08-17 07:59 AM, Irfan Sayed wrote: Hi All, I need to print some string into the file. the string is like this : ?xml version=1.0 encoding=UTF-8? i have written code like this : print MYFILE ?xml version=1.0 encoding=UTF-8?\n where MYFILE is a file handler. if i run this code , it is

Re: print string in file

2010-08-17 Thread Dr.Ruud
Irfan Sayed wrote: print MYFILE ?xml version=1.0 encoding=UTF-8?\n where MYFILE is a file handler. s/handler/handle/ print $MYFILE qq{?xml version=1.0 encoding=UTF-8?\n}; -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail:

Re: PRINT LAST ENTRY IN A FILE

2009-12-02 Thread Dr.Ruud
matt wrote: my @hits = grep /$input/, DATA; quotemeta: my @hits = grep /\Q$input/, DATA; -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: PRINT LAST ENTRY IN A FILE

2009-12-01 Thread matt
On Nov 28, 2:21 pm, paik...@googlemail.com (Dermot) wrote: 2009/11/28 raphael() raphael.j...@gmail.com: 2009/11/28 raphael() raphael.j...@gmail.com: Hi, Hi, # records.txt 25.11.2009 NAME_0 15.12.2006 NAME_3 20.10.2007 NAME_1 01.01.2008 NAME_3    --

Re: PRINT LAST ENTRY IN A FILE

2009-11-30 Thread Dr.Ruud
raphael() wrote: I want to print the last entry by record in this file records.txt grep ^ records.txt |tail -n1 perl -ne '$s=$_ if/^/}{print$s' records.txt -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail:

Re: PRINT LAST ENTRY IN A FILE

2009-11-28 Thread Dermot
2009/11/28 raphael() raphael.j...@gmail.com: Hi, Hi, # records.txt 25.11.2009 NAME_0 15.12.2006 NAME_3 20.10.2007 NAME_1 01.01.2008 NAME_3    -- This whole line should be printed. 10.10.2008 NAME_4 Using while in a while loop matching ( m// ) I get all the

Re: PRINT LAST ENTRY IN A FILE

2009-11-28 Thread Dermot
2009/11/28 raphael() raphael.j...@gmail.com: 2009/11/28 raphael() raphael.j...@gmail.com: Hi, Hi, # records.txt 25.11.2009 NAME_0 15.12.2006 NAME_3 20.10.2007 NAME_1 01.01.2008 NAME_3    -- This whole line should be printed. 10.10.2008 NAME_4 Using

Re: print flips to scientific notation when integer exceeds 15 decimal digits

2009-11-05 Thread David Lee
Philip Potter wrote: 2009/11/4 David Lee david@ecmwf.int: [...] Anyway, your explanation was useful and gives us sufficient to decide how to address our local use of these numbers. (In our case, they are human-oriented accumulated byte-counts, for which we don't actually need that

Re: print flips to scientific notation when integer exceeds 15 decimal digits

2009-11-04 Thread Philip Potter
2009/11/4 David Lee david@ecmwf.int: Many thanks for the reply. Following the initial surprise, my main concern was that attempts to unearth a description or explanation (i.e. documentation) for the observed behaviour was so tricky.  For instance, there was nothing obvious in the relevant

Re: print flips to scientific notation when integer exceeds 15 decimal digits

2009-11-04 Thread David Lee
Philip Potter wrote: I would guess that these numbers are being stored in floats, and that these floats are 64-bit double precision, with 53 bits of mantissa. That means that there are just under 16 decimal digits of precision in these numbers. print and friends seem to automatically print no

Re: print flips to scientific notation when integer exceeds 15 decimal digits

2009-11-03 Thread Philip Potter
2009/11/3 David Lee david@ecmwf.int: Although I've used perl for many years, I've just been surprised (in the unpleasant sense) by a recent event.  Given a variable, say $int, which is a growing integer, I would expect print $int to print it as a simple integer; indeed it usually does so.  

Re: print on the same line

2009-01-06 Thread h3xx
I find it's easier (and in this case totally doable) if you make something like this: for my $count (10 .. 0) { printf STDERR %2d seconds remaining...\n, $count; sleep 1; print STDERR \e[A; } ^ \e[A is the VT-100 code to move the cursor up one line. ^ Also, expanding the number of seconds

Re: print on the same line

2009-01-06 Thread Mr. Shawn H. Corey
On Tue, 2009-01-06 at 06:23 -0800, h3xx wrote: I find it's easier (and in this case totally doable) if you make something like this: for my $count (10 .. 0) { printf STDERR %2d seconds remaining...\n, $count; sleep 1; print STDERR \e[A; } ^ \e[A is the VT-100 code to move the

Re: print on the same line

2009-01-06 Thread John W. Krahn
h3xx wrote: I find it's easier (and in this case totally doable) if you make something like this: for my $count (10 .. 0) { You can't do that in Perl. The range operator has to have the smaller number on the left and the larger number on the right otherwise it will return an empty list and

Re: print on the same line

2009-01-04 Thread Mr. Shawn H. Corey
On Sun, 2009-01-04 at 19:33 -0700, bft wrote: Hello all, I am on a windows box and I am trying to have a count down timer print out the seconds remaining without new lining it. i.e. I do not want a screen that looks like this... 19 seconds remaining 18 seconds remaining 17 ... I

Re: print on the same line

2009-01-04 Thread Eric Krause
Mr. Shawn H. Corey wrote: On Sun, 2009-01-04 at 19:33 -0700, bft wrote: Hello all, I am on a windows box and I am trying to have a count down timer print out the seconds remaining without new lining it. i.e. I do not want a screen that looks like this... 19 seconds remaining 18 seconds

Re: print on the same line

2009-01-04 Thread Chas. Owens
On Sun, Jan 4, 2009 at 22:36, Mr. Shawn H. Corey shawnhco...@magma.ca wrote: snip my $Backup_Count = 0; sub back_and_print { my $text = shift @_; # no tabs, no newlines! print \b x $Backup_Count; print x $Backup_Count; print \b x $Backup_Count; $Backup_Count = length $text;

Re: print on the same line

2009-01-04 Thread Chas. Owens
On Sun, Jan 4, 2009 at 23:11, Eric Krause erickra...@bft1.org wrote: snip Thank you for the reply, but I tried \b and that was one of the escape characters activeState perl has trouble with. snip What version of ActivePerl are you using? I just tested this code against build 1004 (Perl 5.10)

Re: print problem when \r is used.

2008-11-26 Thread John W. Krahn
Cathy wrote: my $lines = 0; my $current_line = 0; my $percentage; my $percentage_new; open(my $FILE, , @ARGV[0]) or die Can't open log file: $!; while (sysread $FILE, $buffer, 4096) { $lines += ($buffer =~ tr/\n//); } print $lines lines\n; close $FILE or die $in: $!; open(my

Re: print $var =~ s/\s+\).$/)./g;

2008-11-21 Thread Mr. Shawn H. Corey
On Fri, 2008-11-21 at 15:13 -0800, [EMAIL PROTECTED] wrote: Is there any way I can get rid of that pesky number and just have the $var string printed? No. Substitution returns the number of substitutions made. Only match will return the matches. -- Just my 0.0002 million dollars worth,

Re: print /! get a newline

2008-10-11 Thread Dr.Ruud
X-post alert: clpm. -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: print /! get a newline

2008-10-11 Thread Jeff Pang
Message du 11/10/08 14:57 De : Dr.Ruud A : beginners@perl.org Copie à : Objet : Re: print /! get a newline X-post alert: clpm. what does this mean? Regards, Jeff. Créez votre adresse électronique [EMAIL PROTECTED] 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

Re: print /! get a newline

2008-10-11 Thread Dr.Ruud
Jeff Pang schreef: Ruud: X-post alert: clpm. what does this mean? http://groups.google.co.uk/groups?as_q=wholethingas_ugroup=comp.lang.perl.miscas_uauthors=april -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: print a line of repeating chars to a file

2008-08-31 Thread John W. Krahn
Dave Thacker wrote: I want to print a line of 50 -'s to a file. This is my non-working syntax. #!/usr/bin/perl open (FOO, foo.out); print FOO repeat(50,-); close FOO; Undefined subroutine main::repeat called at ./foo.pl line 4. Whats the correct syntax for doing this? print FOO '-' x 50;

Re: print reference

2008-07-01 Thread onlineviewer
On Jun 30, 5:38 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: onlineviewer wrote: Can someone tell me the proper syntax to print out the value in a reference? Thank you.,, I'm not sure what you mean. Look: my $string = ''; open my $scalar_fh, '', \$string; So you have opened a file

Re: print reference

2008-06-30 Thread John W. Krahn
onlineviewer wrote: Hello All, Hello, Can someone tell me the proper syntax to print out the value in a reference? I assume you mean how to dereference a reference? perldoc perlref Thank you.,, my $string = ''; open my $scalar_fh, '', \$string; my $log_message = here is my string...;

Re: print reference

2008-06-30 Thread Rob Dixon
onlineviewer wrote: Can someone tell me the proper syntax to print out the value in a reference? Thank you.,, I'm not sure what you mean. Look: my $string = ''; open my $scalar_fh, '', \$string; So you have opened a file handle to append to the scalar $string. my $log_message = here is

Re: print spanish symbols

2008-03-14 Thread obdulio santana
2008/3/13, Jenda Krynicky [EMAIL PROTECTED]: From: obdulio santana [EMAIL PROTECTED] 2008/3/12, Jenda Krynicky [EMAIL PROTECTED]: . . I see. Sorry. Properly set is not enough when it comes to Windows. MS Windblows uses two encodings. For reasons I would love to have a word

Re: print spanish symbols

2008-03-13 Thread obdulio santana
2008/3/12, Jenda Krynicky [EMAIL PROTECTED]: From: obdulio santana [EMAIL PROTECTED] I want to show some áéíóú or ~n ~N in my program but I dont know how to print it in a properly way; perl -e print \algodón\n\ algod 3/4 n thanks in advance. I'm afraid you'll have to tell

Re: print spanish symbols

2008-03-13 Thread Jenda Krynicky
From: obdulio santana [EMAIL PROTECTED] 2008/3/12, Jenda Krynicky [EMAIL PROTECTED]: From: obdulio santana [EMAIL PROTECTED] I want to show some áéíóú or ~n ~N in my program but I dont know how to print it in a properly way; perl -e print \algodón\n\ algod 3/4 n

Re: print spanish symbols

2008-03-12 Thread eMko
I do not know if this helps you (I am a Perl beginner, too - previously i used Java where I did not have problems with character encoding), but when I needed to print out some special Czech symbols (ěščřžýáíéďťň etc.), I had to tell Perl to use an utf8 encoding. use utf8; binmode (STDIN, 'utf8');

Re: print spanish symbols

2008-03-12 Thread Jenda Krynicky
From: obdulio santana [EMAIL PROTECTED] I want to show some áéíóú or ~n ~N in my program but I dont know how to print it in a properly way; perl -e print \algodón\n\ algod 3/4 n thanks in advance. I'm afraid you'll have to tell us what operating system you use. The problem is most

Re: print records that match regexp

2008-01-29 Thread bbrecht56
On Jan 28, 6:11 pm, [EMAIL PROTECTED] (Chas. Owens) wrote: On Jan 28, 2008 4:12 PM, [EMAIL PROTECTED] wrote: I have a table customer_table with the following fields: Id int, firstname varchar(64), lastname varchar(64), emailaddress varchar(64) not null primary key city varchar

Re: print records that match regexp

2008-01-29 Thread Chas. Owens
On Jan 29, 2008 2:03 AM, [EMAIL PROTECTED] wrote: snip Sorry, I missed the ^ for the regexp ^A+ snip The ^ should only be used if you were to use Perl regexes, and even then your expression would not match anything but strings that held As (+ matches the last character 1 or more times). But

Re: print records that match regexp

2008-01-29 Thread bbrecht56
On Jan 29, 5:55 am, [EMAIL PROTECTED] (Chas. Owens) wrote: On Jan 29, 2008 2:03 AM, [EMAIL PROTECTED] wrote: snip Sorry, I missed the ^ for the regexp ^A+ snip The ^ should only be used if you were to use Perl regexes, and even then your expression would not match anything but strings that

Re: print records that match regexp

2008-01-28 Thread Chas. Owens
On Jan 28, 2008 4:12 PM, [EMAIL PROTECTED] wrote: I have a table customer_table with the following fields: Id int, firstname varchar(64), lastname varchar(64), emailaddress varchar(64) not null primary key city varchar (32), Can some one help me and show me how to print only records that

Re: print a selection of a file

2008-01-09 Thread Martin Barth
#!/opt/perl/bin/perl -w use strict; #variable my @horcm_file; sub readdata{ open(HORCM, /etc/horcm10.conf) || die (File error); @horcm_file = HORCM; chomp(@horcm_file); close(HORCM); return(@horcm_file); } my @pipo=readdata(); foreach (@pipo){ /HORCM_INST/ or

Re: print a selection of a file

2008-01-09 Thread Paul Lalli
On Jan 9, 4:36 am, [EMAIL PROTECTED] (Jonay Herrera) wrote: Hello, I try  to  print (get)  a specific text selection from  a  text file, but  I don't know  how to  do  it: What I try  todo  is  to open a  file search  a string and  print the  follow lines from that  string until he found  a

Re: print a selection of a file

2008-01-09 Thread Rob Dixon
[EMAIL PROTECTED] wrote: Hello, I try to print (get) a specific text selection from a text file, but I don't know how to do it: What I try todo is to open a file search a string and print the follow lines from that string until he found a white line. then he need to stop. so

Re: print 2 valuable

2007-08-04 Thread Chas Owens
On 8/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am new in perl. i want print 2 valuable in same line but my script it print split into 2 line. if i hard code will work. i dont understand why is happen. can some please explain to me thanks, #!/usr/bin/perl print which client\n; $a =

Re: print 2 valuable

2007-08-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: I am new in perl. i want print 2 valuable in same line but my script it print split into 2 line. if i hard code will work. i dont understand why is happen. can some please explain to me thanks, #!/usr/bin/perl print which client\n; $a = ; $db = ; $dir=/u1/data/$a;

Re: print 2 valuable

2007-08-04 Thread Sydney
On Aug 4, 2:45 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: [EMAIL PROTECTED] wrote: I am new in perl. i want print 2 valuable in same line but my script it print split into 2 line. if i hard code will work. i dont understand why is happen. can some please explain to me thanks,

RE: print if variable matches key

2007-02-28 Thread Brian Volk
-Original Message- From: Brian Volk [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 28, 2007 1:34 PM To: beginners@perl.org Subject: print if variable matches key Hello, I'm trying to print a tab delimited file based on a colon separated file matching a key in %hash.

RE: print if variable matches key

2007-02-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
-Original Message- From: Brian Volk [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 28, 2007 12:24 To: Brian Volk; beginners@perl.org Subject: RE: print if variable matches key -Original Message- From: Brian Volk [mailto:[EMAIL PROTECTED] Sent: Wednesday

RE: print if variable matches key

2007-02-28 Thread Brian Volk
-Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 28, 2007 3:31 PM To: Brian Volk; Brian Volk; beginners@perl.org Subject: RE: print if variable matches key I am jusmping into the middle, so

Re: Print output of Table on browser as it is being created

2006-09-12 Thread jeffhua
Hi, You just need to print the table lines in a loop when you're querying the datas from db. for example,maybe you can write it like: print table; while(my $sql_line_ref = $sth-fetchrow_hashref) { print qq {trtd$sql_line_ref-{key1}/td td$sql_line_ref-{key2}/td

Re: Print to new file for each results

2006-08-30 Thread Ken Foskey
On Wed, 2006-08-30 at 00:16 -0400, Ron McKeever wrote: I am tring to use part of someones elses code that creates a data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data If you can ignore efficiency (not run very often...) then you can

Re: Print to new file for each results

2006-08-29 Thread Mumia W.
On 08/29/2006 06:32 PM, Ron McKeever wrote: I am try to use part of someones elses code that creats the data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file

Re: Print to new file for each results

2006-08-29 Thread John W. Krahn
Ron McKeever wrote: I am tring to use part of someones elses code that creates a data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file for each

RE: print statement error

2006-07-20 Thread Timothy Johnson
It works for me, but it sounds like '[A-Z][a-z]+' might not be doing what you think. That says One upper-case letter followed by one or more lower-case letters. I can see one problem with that right now. I live in Santa Clara, which won't match because it has a space in it. But this matched:

Re: print Greek small letter alpha in html

2006-06-14 Thread Mr. Shawn H. Corey
On Thu, 2006-15-06 at 10:04 +0800, Ken Perl wrote: hi, To print Greek small letter alpha in a html page, I tried to print this in perl but not work, #03B1; could someone give me some clue how to make this work? Yes ... I think so. How about: #x03b1; -- __END__ Just my 0.0002

Re: print Greek small letter alpha in html

2006-06-14 Thread may sandi
Hi, Does anybody know how can run a perl file from java? I already tried with following command: try { Runtime r = Runtime.getRuntime(); String cmdLine[] = { /usr/bin/perl,c:/link41a/linkparser2.pl}; r.exec(cmdLine); But, I doesn't work. Currently I am using jdk 1.4. thanks in

RE: Print

2006-05-19 Thread Nagasamudram, Prasanna Kumar
Hi Kaushal The only alternative I can think of is to convert your chm file to pdf or rtf and then attempt a print. You can get the convert from http://www.freedownloadscenter.com/Best/free-chm-to-pdf.html Also can you please send me the chm file? It can be quite handy to me. Thanks

RE: Print

2006-05-19 Thread Saboo, Nandakishore
Hi Hi Kaushal The only alternative I can think of is to convert your chm file to pdf or rtf and then attempt a print. You can get the convert from http://www.freedownloadscenter.com/Best/free-chm-to-pdf.html Also can you please send me the chm file? It can be quite handy to me. I think

Re: Print

2006-05-18 Thread David Romano
Hi Kaushal, On 5/18/06, Kaushal Shriyan wrote: I have perl.chm file Learning Perl, How do i print all the chapters and all pages in the perl.chm file How did you get the book in .chm format? I only know of it being available on paper and on safari.oreilly.com. It's a great book (I learned from

RE: print file

2006-05-08 Thread Thomas Bätzler
badrinath chitrala [EMAIL PROTECTED] asked: open FILE, file.txt or die $!; while (f:/file.txt) Sombody please tell me why do i get the message as below if i want to print the contents of text file I would suggest you use the three argument open, i.e. OPEN FILE, '', $file or die

Re: print file

2006-05-08 Thread John W. Krahn
badrinath chitrala wrote: Hi Hello, open FILE, file.txt or die $!; open() creates the filehandle FILE which is associated with the contents of the file file.txt. while (f:/file.txt) You are using a file glob to get a list of file names which is the same as doing: while ( defined( $_ =

RE: print file

2006-05-08 Thread Bedanta Bordoloi, Gurgaon
Try this: open(FILE,f:/file.txt) || print(open() failed as file did not exist.\n); while (FILE){ print $_; } Bedanta -Original Message- From: badrinath chitrala [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:46 PM To: beginners@perl.org Subject: print file Hi open

RE: print file

2006-05-08 Thread Timothy Johnson
. -Original Message- From: Bedanta Bordoloi, Gurgaon [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:24 AM To: badrinath chitrala; beginners@perl.org Subject: RE: print file Try this: open(FILE,f:/file.txt) || print(open() failed as file did not exist.\n); snip: code

Re: print interactive debugging info into a file

2006-02-18 Thread Peter Scott
On Sat, 18 Feb 2006 16:20:10 +0800, Ken Perl wrote: The DB::OUT filehandle is opened to /dev/tty, regardless of where STDOUT may be redirected to, so it's impossible to print the interactive debugging info into a file? I tried 'x @session /tmp/data' in the debugger and didn't work. Why don't

RE: print to a specific location in a file

2005-08-01 Thread Brian Volk
-Original Message- From: Brian Volk Sent: Monday, August 01, 2005 11:03 AM To: Beginners (E-mail) Subject: print to a specific location in a file Hi All~ Is it possible to open a file and print to a specific location in the file? For example, I have a 1K file and 0 - 511 is where

Re: print to a specific location in a file

2005-08-01 Thread John W. Krahn
Brian Volk wrote: Is it possible to open a file and print to a specific location in the file? For example, I have a 1K file and 0 - 511 is where the small description is stored and starting in position 512 is the path to a pdf file If I do not have the path in position 512 the link

RE: print with +split

2005-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: All, Here is my code: use strict; use warnings; my $dev = qw/original1/; my $dev1 = qw/clinical1/; my $fout = qq(/usr/local/log/fuji.out); open (OUT, +$fout) || die unable to open file: $fout $!; open (FOO, samcmd a $dev 2\1 | ) || die unable

RE: print with +split

2005-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: All, Here is my code: use strict; use warnings; my $dev = qw/original1/; my $dev1 = qw/clinical1/; my $fout = qq(/usr/local/log/fuji.out); open (OUT, +$fout) || die unable to open file: $fout $!; open (FOO, samcmd a $dev 2\1 | ) || die unable

RE: print with +split

2005-03-11 Thread DBSMITH
Subject PMRE: print with +split

RE: print with +split

2005-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Subject PMRE: print with +split [EMAIL PROTECTED] wrote: All, Here is my code: use strict; use warnings; my $dev = qw/original1/; my $dev1 = qw/clinical1/; my $fout = qq(/usr/local/log/fuji.out); open (OUT

RE: print with +split

2005-03-11 Thread DBSMITH
] [EMAIL PROTECTED] cc ight.fedex.com beginners@perl.org Subject 03/11/2005 04:59 RE: print with +split

  1   2   3   >