Re: Why is this not working?

2006-12-07 Thread John W. Krahn
Mathew Snyder wrote: > Code snippet at the end of my little script: > > > ... > my $count; > foreach my $email (@emails){ > print $email, "\n"; > $count += 1; > }; > > if ($count > 0){ > print "\n" . "count = " . $count . "\n"; > } > else{ > print "count = 0"; > }

Why is this not working?

2006-12-07 Thread Mathew Snyder
Code snippet at the end of my little script: ... my $count; foreach my $email (@emails){ print $email, "\n"; $count += 1; }; if ($count > 0){ print "\n" . "count = " . $count . "\n"; } else{ print "count = 0"; }; exit; I've declared $count globally so I can use i

Re: Line ending with Gary"^M on UNIX

2006-12-07 Thread Omega -1911
On 12/7/06, Moon, John <[EMAIL PROTECTED]> wrote: Can someone please give me the octal values or a method of removing ^M from the end of an input line, if present? Try this: $input =~ s/\cM//g;

Re: Line ending with Gary"^M on UNIX

2006-12-07 Thread Ron Wingfield
#!/usr/bin/perl -w # The intent of this program is to remove a trailing # line feed character (^M) from a text line. $input_file = $ARGV[0]; $output_file = $ARGV[1]; open (INFILEHANDLE, "<$input_file") or die "Cannot open file, $input_file\n"; open (OUTFILEHANDLE, ">$output_file")

Re: Line ending with Gary"^M on UNIX

2006-12-07 Thread Ron Smith
--- "Moon, John" <[EMAIL PROTECTED]> wrote: > Can someone please give me the octal values or a > method of removing ^M > from the end of an input line, if present? > > Thank you in advance > > jwm > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL

Re: Line ending with Gary"^M on UNIX

2006-12-07 Thread John W. Krahn
Moon, John wrote: > Can someone please give me the octal values or a method of removing ^M > from the end of an input line, if present? You could use the dos2unix command: dos2unix yourfile And if you want to do it with Perl: perl -i -pe'y/\cM//d' yourfile John -- Perl isn't a toolbox, but

Line ending with Gary"^M on UNIX

2006-12-07 Thread Moon, John
Can someone please give me the octal values or a method of removing ^M from the end of an input line, if present? Thank you in advance jwm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Checking for infinite loops

2006-12-07 Thread Jay Savage
On 12/7/06, hOURS <[EMAIL PROTECTED]> wrote: Thanks for trying, but this right here is the heart of the matter. I'd be using alarm to time a certain thing. It seems to me, any explanation of how to do that, be it plain English or sample code has to incorporate that thing.

Using connect_cached

2006-12-07 Thread Prashanth Meka
Hi, I am trying to find a function that will create a persistent connection. Does connect_cached provide a persistent connection? From the CLI/ODBC traces, it looks like this program connects two separate times to the database: $dbh1 = DBI->connect_cached("dbi:DB2:SAMPLE", "user", "pass"); $dbh1

Re: Re: Checking for infinite loops

2006-12-07 Thread Tom Phoenix
On 12/6/06, hOURS <[EMAIL PROTECTED]> wrote: My program in a nutshell goes: Blah blah blah the beginning part require someprogramthatmayhaveaninfiniteloop.pl Blah blah blah the ending part You must have a good reason for using a buggy library without first fixing its b

Re: Checking for infinite loops

2006-12-07 Thread D. Bolliger
hOURS am Donnerstag, 7. Dezember 2006 06:51: > Thanks for trying, but this right here is the heart of the matter. > I’d be using alarm to time a certain thing. It seems to me, any > explanation of how to do that, be it plain English or sample code has to > incorporate that thing. My progr

Re: Perl Query - Conversion of EXE file

2006-12-07 Thread Derek B. Smith
> > > The input for the EXE has to be taken from the > file provided by the > > > user.AndThe EXE shud get invoked by just > dragging and dropping the > > > input file on the EXE. > > > > > > Assume, the input file is some text file > containing some raw data. > > > > > > How should this be done? >

Re: Writing routines with future changes in mind

2006-12-07 Thread Nigel Peck
Jeff Pang wrote: I also think this is the best way for your purpose.You can pass a hash ref to subroutine,and store any arguments you want to be past > to the subroutine in that hash. > ... Thanks for this. I'm going to do this, I think you're right it seems to fit what I need. Mug wrote: >

Re: Checking for infinite loops

2006-12-07 Thread Mumia W.
On 12/06/2006 11:51 PM, hOURS wrote: Thanks for trying, but this right here is the heart of the matter. I'd be using alarm to time a certain thing. It seems to me, any explanation of how to do that, be it plain English or sample code has to incorporate that thing. My

Re: CGI XML

2006-12-07 Thread Bill Jones
On 12/7/06, Beginner <[EMAIL PROTECTED]> wrote: my $xml = eval {XMLin($fh, SuppressEmpty => 1, ForceArray => qr/item/) }; CGI::Lite and then use $cgi->parse_new_form_data; to get the XML into your $xml hash. -- WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/ -- To unsubscri

Re: How to read unicode data?

2006-12-07 Thread kilaru rajeev
Thanks for your help. Rajeev Kilaru On 12/7/06, zentara <[EMAIL PROTECTED]> wrote: On Tue, 5 Dec 2006 19:18:50 +0530, [EMAIL PROTECTED] ("kilaru rajeev") wrote: >Hi All, > >I got a "Little-endian UTF-16 Unicode C program character data, with very >long lines, with CRLF line terminators" file.

Re: beginner

2006-12-07 Thread Dermot Paikkos
On 7 Dec 2006 at 3:47, isaac vanderpuije wrote: > > yes am using the x86 processor, i installed and didnt see any sign of > perl on my PC > > Beginner <[EMAIL PROTECTED]> wrote: > On 7 Dec 2006 at 3:31, isaac vanderpuije wrote: > > > have a problem installing the perl msi(windows platf

Re: beginner

2006-12-07 Thread Beginner
On 7 Dec 2006 at 3:31, isaac vanderpuije wrote: > have a problem installing the perl msi(windows platform) can anyone help me, > because i need to learn perl urgently. thanks > Could you give us a few more details about the error message and what you've done to try and install it. What is yo

beginner

2006-12-07 Thread isaac vanderpuije
have a problem installing the perl msi(windows platform) can anyone help me, because i need to learn perl urgently. thanks - Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.

Re: Writing routines with future changes in mind

2006-12-07 Thread Jeff Pang
> >I thought about using a hash instead of a list of variables. > > >example_sub ( > { > some_scalar => $some_scalar, > some_hash_ref => $some_hash_ref, > some_string => 'some string', > } >); > >So I could add to it any way I wanted and write

Re: Writing routines with future changes in mind

2006-12-07 Thread Mug
Nigel Peck wrote: > > Hi all, > > I'm hoping to get some ideas on how to write my subs, specifically on > passing variables into them and how best to do it. > > Currently I do this: > > > example_sub ( $some_scalar, $some_hash_ref, 'some string' ); > > sub example_sub { > my ( $passed_scalar, $pass

Latest Perl in Cygwin is 5.8.7?

2006-12-07 Thread Adriano Ferreira
Does anyone know why the latest Perl in Cygwin packages is 5.8.7, and not 5.8.8? I know I can compile Perl by myself and I did it. But when it becomes a package in the standard Cygwin distribution it becomes more widely available. So what's keeping 5.8.8 to enter the Cygwin package repository? Any

Writing routines with future changes in mind

2006-12-07 Thread Nigel Peck
Hi all, I'm hoping to get some ideas on how to write my subs, specifically on passing variables into them and how best to do it. Currently I do this: example_sub ( $some_scalar, $some_hash_ref, 'some string' ); sub example_sub { my ( $passed_scalar, $passed_hash_ref, $passed_string

CGI XML

2006-12-07 Thread Beginner
Hi, I have made a script that reads a XML file from disk and creates a PDF from the content. The script currently uses XML::Simple to parse the XML data. For the next phase I would like to receive the PDF from XML via HTTP, rather than have to slurp up the file from disk. I believe this is po

Re: Missing suidperl

2006-12-07 Thread Ken Foskey
On Wed, 2006-12-06 at 11:10 -0800, Tom Phoenix wrote: > On 12/6/06, Gene Bomgardner <[EMAIL PROTECTED]> wrote: > > > A package I was running uses suidperl. > > > > For some reason, it's disappeared. I need to replace it. > > In order to minimize security risks, suidperl is no longer a routine > p