Re: False warning by warnings.pm

2004-11-23 Thread David le Blanc
On Mon, 22 Nov 2004 09:29:04 -0500, Bob Showalter [EMAIL PROTECTED] wrote: Ramprasad A Padmanabhan wrote: I am using Net::Telnet in one of my perl scripts. Problem is every time it runs with use warnings It prints out warnings like Unrecognized escape \s passed through at

Re: Why is not sub necessary? What is the difference: block and expression?

2004-10-31 Thread David le Blanc
On Fri, 29 Oct 2004 10:29:21 -0600, Siegfried Heintze [EMAIL PROTECTED] wrote: I'm trying to understand the map function in perl and have been studying David's response to my earlier query. When David calls his iterate function, why does he not need to use the keyword sub? Apparently he is

Re: Determine the Binary format of a file

2004-10-27 Thread David le Blanc
Assuming the file isn't some known standard which is discovered by interrogating the header (ala unix 'file myfile') you will need to understand the format of the file before we can help defined an unpack template. Any ideas where to start? Generally I try and determine record size and delimiter

Re: Reading from a filehandle in while-loop

2004-10-26 Thread David le Blanc
On Tue, 26 Oct 2004 11:33:24 +0200, Bastian Angerstein [EMAIL PROTECTED] wrote: Why does this donĀ“t work in my Script? open (TEST, /tmp/test.txt); while (TEST) { print $_; # or just print; } You are making the assumption that 'TEST' sets '$_' which is not true. Oddly, perl makes

Re: Error: Line too long

2004-10-23 Thread David le Blanc
On Fri, 22 Oct 2004 02:05:33 -0700 (PDT), Melis Mutlu [EMAIL PROTECTED] wrote: Hi, I would like to write a whole string into a file with the following code: open(NEW, new.txt) or die cannot open new_acl.txt; open(OUT, test); while(my $line=NEW) { chop $line;

Re: File read qn

2004-10-22 Thread David le Blanc
On Fri, 22 Oct 2004 20:13:05 -0700 (PDT), Ajey Kulkarni [EMAIL PROTECTED] wrote: howdy!! I've a code snipped that reads the file into array. The file is a comma separated file. I want to say get 4th column of the whole file in an array. @lines = LIB::readFile($opt{f}); My @lines has the

Re: What search string do I use on google or perldoc ...

2004-10-22 Thread David le Blanc
On Sat, 23 Oct 2004 00:32:09 +0200, Jenda Krynicky [EMAIL PROTECTED] wrote: From: Ken Wolcott [EMAIL PROTECTED] What search string do I use on google or perldoc so that I know how to display a specified range of lines from a file (like sed -n 24, 48p filename)? Have you considered 'man

Re: Module help

2004-10-22 Thread David le Blanc
On Fri, 22 Oct 2004 16:34:52 -0400, Bob Showalter [EMAIL PROTECTED] wrote: Jim Goh wrote: Hi, I try to use module CGI::Session:DB_File for the following: #!/usr/bin/perl use strict; use CGI; use lib '.'; This is unnecessary; . is a part of @INC by default. use

Re: Limits on globbing?

2004-10-22 Thread David le Blanc
On 22 Oct 2004 06:41:10 -0700, Randal L. Schwartz [EMAIL PROTECTED] wrote: Bryan == Bryan Harris [EMAIL PROTECTED] writes: Bryan I'm using the: Bryan @files = *.in; Bryan ... notation with Perl 5.0. If I have too many files, @files ends up with Bryan nothing. Is there a way to read

Re: Parsing multiline data

2004-10-21 Thread David le Blanc
On Thu, 21 Oct 2004 14:55:28 +0800, Bee [EMAIL PROTECTED] wrote: use strict; open F, sourcefile.txt; local $/ = \n\n; my @sections = F; close F; print Section $_ :\n $sections[$_]\n\n for @sections; What are you doing to poor Kevin? If you meant: print Section $_:\n

Re: Need help to calculate average value in hash

2004-10-20 Thread David le Blanc
On Wed, 20 Oct 2004 02:08:12 +0200, Gunnar Hjalmarsson [EMAIL PROTECTED] wrote: Pete Tong wrote: I have file: PHI: 15 CA: 32 NY: 14 PHI: 35 NY: 11 CA: 22 NY: 23 CA: 36 I need to put it into hash. Key State, Value Number (Average Value!!!) So in output I should have:

Re: Parsing multiline data

2004-10-20 Thread David le Blanc
On Wed, 20 Oct 2004 22:27:20 -0400, Kevin Old [EMAIL PROTECTED] wrote: Hello everyone, I have several sections of data that look like this: Title: DESIGN JOURNAL (COVER) Purpose: Product Spotlight Penetration: National Role: Media Relations, Content Support Results: Elevated Publicity

Re: I'm confused: where are the commas for map and sort

2004-10-11 Thread David le Blanc
On Sun, 10 Oct 2004 14:30:32 -0600, Siegfried Heintze [EMAIL PROTECTED] wrote: The map and the sort statements are strange. Why don't they require a comma between the first and second arguments? They are not special, they are just using a special semantic built into perl. Consider the

Re: in a regex- re-arrange $1..$n

2004-10-11 Thread David le Blanc
On Mon, 11 Oct 2004 13:13:37 -0600, Wiggins d Anconia [EMAIL PROTECTED] wrote: the following is an as yet incomplete regex that i'm working on: $data = $_ =~ s/(name)(.*?)(desc)(.*?)(copy)(.*?)(license)(.*?)(entry)//xg Are you thinking of : ( $a1,$b1,$a2,$b2,$a3,$b3,$a4,$b4,$a5,$b5 )

Re: Need Help

2004-10-07 Thread David le Blanc
This is an example of perl regular expression greediness. check 'perldoc perlre' and search for greediness. You might want to use something like s/$openTag.*?$closeTag/New/g the extra '?' does not mean what you think it means when it follows a + or a * :-) Sorry for the top post. On Thu,

Re: Open file with default application software on Windows ?

2004-10-07 Thread David le Blanc
Search for a program called 'shellexec'. (use google). Shellexec does exactly what you want, but its a windows executable, so instead of calling defopen something; try system(shellexec something); you should be able to download shellexec or an equivalent from many places. As for portable?

Re: Open file with default application software on Windows ?

2004-10-07 Thread David le Blanc
On Thu, 07 Oct 2004 16:10:29 +0200, Jenda Krynicky [EMAIL PROTECTED] wrote: From: Bee [EMAIL PROTECTED] I am curious to know that if that is an existed module to open files with it's default application just like I double click on the file with mouse. and I do something just like this with

Re: newbie stuck in a HOA

2004-10-06 Thread David le Blanc
You should, ah, ace that homework with the kind of help you got on this one :-) On Wed, 6 Oct 2004 09:06:52 +0800, Bee [EMAIL PROTECTED] wrote: Try this and hope this would help more *Code not tested* Suppose data in cancel.txt : 123456|X 234567|X Suppose data in falldata.tmp :

Re: Reg Exp

2004-10-06 Thread David le Blanc
On Tue, 05 Oct 2004 15:22:25 -0700, John W. Krahn [EMAIL PROTECTED] wrote: [Please do not top-post. TIA] David le Blanc wrote: On Tue, 05 Oct 2004 04:03:21 -0700, John W. Krahn [EMAIL PROTECTED] wrote: Mallik wrote: I have the below code. my $a = :-:m:-:a:-:l:-:i:-:k; # Here

Re: Reg Exp

2004-10-05 Thread David le Blanc
Your use of (.?)($del)? does not do what you expect. In the case of :-:a:-: you will find (.?) = 'a' and ($del)? matches a delimiter, BUT :-::-:you will find (.?) = : and ($del)? matches nothing. Check out 'look-ahead' matches for a way to solve this. On Tue, 05 Oct 2004 04:03:21

Fwd: how to skip new line character

2004-09-09 Thread David le Blanc
-- Forwarded message -- From: David le Blanc [EMAIL PROTECTED] Date: Thu, 9 Sep 2004 16:54:56 +1000 Subject: Re: how to skip new line character To: Anish Kumar K. [EMAIL PROTECTED] Is the problem either 1) Remove the end of line character from all lines 2) Remove the end of line

Re: CC will not send any mail :-(

2004-09-09 Thread David le Blanc
The code you have provided does not insert a blank line between the header data (from, to, cc, subject, etc) and the message body. This seems to cause your mailer to treat the whole message a 'message body' which is why the recipient gets an email with the 'CC' line separated from the header by a

RE: Perl -d

2004-03-15 Thread David le Blanc
-Original Message- From: Mike Ni [mailto:[EMAIL PROTECTED] Sent: Tuesday, 16 March 2004 3:46 PM To: [EMAIL PROTECTED] Subject: Perl -d Hey everyone, While I was playing with perl's built-in debuger (perl -d), I notice that debugger doesn't seem care too much about

RE: Perl -d

2004-03-15 Thread David le Blanc
: Mike Ni [mailto:[EMAIL PROTECTED] Sent: Tuesday, 16 March 2004 5:57 PM To: David le Blanc Subject: RE: Perl -d Hey David, Thanks for the information. BTW, I want to follow up another question, if I may. I am still struggling with the perl -d. Here is the problem I want to solve

RE: Debugging(perl -d)

2004-03-14 Thread David le Blanc
-Original Message- From: Mike Ni [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 10:43 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Debugging(perl -d) Hey, I was handed several perl files written for the Apache Web Server. The person who wrote these isn't

RE: Read from tape device

2004-03-11 Thread David le Blanc
-Original Message- From: R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, 10 March 2004 5:37 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Read from tape device [EMAIL PROTECTED] wrote: Hi All, I am trying to read some data from af unix tape

RE: HERE DOCUMENTS and teachable moments

2004-03-09 Thread David le Blanc
-Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Tuesday, 9 March 2004 5:54 PM To: [EMAIL PROTECTED] Subject: Re: HERE DOCUMENTS and teachable moments R. Joseph Newton wrote: Better just to respond to the situations as they arise. Sometimes this will

RE: Enable Perl Debugging at Run-Time

2004-03-09 Thread David le Blanc
-Original Message- From: zentara [mailto:[EMAIL PROTECTED] Sent: Wednesday, 10 March 2004 1:41 AM To: [EMAIL PROTECTED] Subject: Re: Enable Perl Debugging at Run-Time On Tue, 9 Mar 2004 12:07:18 +1100, [EMAIL PROTECTED] (David Le Blanc) wrote: Hey all. This works

RE: Enable Perl Debugging at Run-Time

2004-03-09 Thread David le Blanc
-Original Message- From: WC Jones [mailto:[EMAIL PROTECTED] Sent: Wednesday, 10 March 2004 11:55 AM To: David le Blanc Subject: Re: Enable Perl Debugging at Run-Time On Wed, Mar 10, 2004 at 11:15:39AM +1100, David le Blanc wrote: While inside a CGI script? enlighten me

RE: Modifying text in a shell script from Perl

2004-03-08 Thread David le Blanc
-Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Tuesday, 9 March 2004 6:58 AM To: Rajesh Dorairajan Cc: Perl-Beginners (E-mail) Subject: Re: Modifying text in a shell script from Perl Rajesh Dorairajan wrote: cat copyright | more Useless use of cat

Enable Perl Debugging at Run-Time

2004-03-08 Thread David le Blanc
Hey all. I need to trace / debug a CGI script which basically involves lots of 'print DEBUG_FH'. I noticed the existence of the Devel::Trace module which allows you to trace your perl script to STDERR eg, perl -d:Trace myprog.pl However, since my program is a CGI, I've come across a

RE: Passing Data Between Servers

2004-03-05 Thread David le Blanc
problems manually. If you can email the data, you have a proven delivery mechanism to base the rest of your code on. Then your server code is run by placing '|myperlcode -w' into a '.forward' files. Regards, David le Blanc -- Senior Technical Specialist I d e n t i t y

RE: Handling blank lines in while(CONF) construct

2004-03-05 Thread David le Blanc
From: Michael Weber [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 2:16 AM To: [EMAIL PROTECTED] Subject: Handling blank lines in while(CONF) construct I wrote a perl script that adds colors to text streams on the fly. It's really handy for watching log files as they run past. I

RE: Handling blank lines in while(CONF) construct

2004-03-05 Thread David le Blanc
-Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 4:16 AM To: Michael Weber Cc: [EMAIL PROTECTED] Subject: Re: Handling blank lines in while(CONF) construct As far as this: $yellow)} elsif ( $conf_line[1] =~ blue )

RE: Passing Data Between Servers

2004-03-05 Thread David le Blanc
-Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 8:19 PM To: perl Subject: Re: Passing Data Between Servers David le Blanc wrote: Aha! I always wanted to rewrite MQSeries. This might be the opportunity! Do you want

RE: Perl script to switch user to root.

2004-03-05 Thread David le Blanc
-Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 5:13 AM To: Silky Manwani Cc: [EMAIL PROTECTED] Subject: Re: Perl script to switch user to root. Silky Manwani wrote: Hello, I want to write a perl script to switch user (to root).

RE: Cygwin: Port of unix commands or unix-like environment

2004-03-05 Thread David le Blanc
-Original Message- From: Joel [mailto:[EMAIL PROTECTED] Sent: Saturday, 6 March 2004 1:29 PM To: perl Subject: Re: hi!! I've changed your subject to be more appropriate to the question asked. This is off topic, but is cygwin just the ports of GNU software for windows, or is

RE: perl hex editor

2004-03-04 Thread David le Blanc
\nThere..\b\b\n; my $ascii = EncodeBase64( $binary_data ); print ASCII = $ascii.$/; my $binary = DecodeBase64( $ascii ); print binary = $binary.$/; snip -- Regards, David le Blanc -- Senior Technical Specialist I

RE: Passing array as First argument

2004-03-03 Thread David le Blanc
From: Mallik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 March 2004 1:00 AM To: Perl Beginners Subject: Passing array as First argument Importance: High Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters

RE: Reformatting the Date

2004-03-03 Thread David le Blanc
From: John [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 March 2004 8:55 PM To: Perl Beginners Subject: Reformatting the Date Hi John! I receive the date from the Oracle as DD/MM/YY and i want to insert that date in a mysql date field. If you get a date in var '$odate', you need to

RE: Returning value from system()

2004-03-03 Thread David le Blanc
From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 4:54 PM To: [EMAIL PROTECTED] Subject: Re: Returning value from system() [EMAIL PROTECTED] wrote: Hi all, I executed the same version of the perl script(code is given below) which use the system()

RE: print a 3D array

2004-03-02 Thread David le Blanc
-Original Message- From: R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 7:20 PM To: John Cc: Perl Beginners Subject: Re: print a 3D array John wrote: Problem with my array 0Tk::Error: Can't use string (ARRAY(0x22bdfb0)) as an ARRAY ref while

RE: subroutine definitions

2004-03-02 Thread David le Blanc
-Original Message- From: zsdc [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 4:54 PM To: Andrew Gaffney Cc: 'beginners' Subject: Re: subroutine definitions Andrew Gaffney wrote: zsdc wrote: Confusion? You should read 6th Apocalypse by Larry Wall and the

RE: listing prime numbers in a range (Beginning Perl exercise)

2004-03-02 Thread David le Blanc
Just for the sake of it, and I apologise profusely for the top posting.. Here is a summary of the posted prime calculators for testing your results against. (1) Ohad #--- perl -e 'print@{[grep{(1x$_)!~/^(11+?)\1+$/}2..shift||1e2]}\n' number

RE: listing prime numbers in a range (Beginning Perl exercise)

2004-03-02 Thread David le Blanc
-Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 March 2004 12:13 AM To: David le Blanc Cc: [EMAIL PROTECTED] Subject: RE: listing prime numbers in a range (Beginning Perl exercise) David le Blanc said: Here is a summary of the posted

RE: listing prime numbers in a range (Beginning Perl exercise)

2004-03-02 Thread David le Blanc
From: Stuart White [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 11:55 PM To: David le Blanc; [EMAIL PROTECTED] Subject: RE: listing prime numbers in a range (Beginning Perl exercise) --- David le Blanc [EMAIL PROTECTED] wrote: Just for the sake of it, and I apologise

Sharing functions and symbols between modules.

2004-03-02 Thread David le Blanc
} : $type eq '@' ? [EMAIL PROTECTED]$ssym} : $type eq '%' ? \%{$ssym} : $type eq '*' ? *{$ssym} : undef; } } 1; --- snip -- Regards, David le Blanc -- Senior Technical Specialist http

RE: data filtering

2004-03-01 Thread David le Blanc
Mr.David, I have few questions: 1. What is the function of Scope Resolution Operator :: used in the code you sent me? (filter::$col[$i]) 2. What are the arguments for the sub routine filterspec? you have put sub filterspec($@). 3. What is the output expected out of map{

RE: Fun module of the Month

2004-02-28 Thread David le Blanc
From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 9:48 PM To: '[EMAIL PROTECTED]' Subject: Fun module of the Month Acme::Eyedrops (with apologies to Andrew J. Savige) However, I find it strange that perl -MCPAN -e shell install Acme::Eyedrops

RE: subroutine call weirdness

2004-02-27 Thread David le Blanc
(0,0,0,1,0,100) } Hence, the perl compiler *knows* that no arguments could possibly be passed to the function, and thus none will. Your test cases should now run properly. HTH David Regards, David le Blanc -- Technical Specialist http://www.identity-solutions.com.au/ I d e n t i

RE: target practice -- lottery numbers

2004-02-27 Thread David le Blanc
$k=1; while($k(($i-1)*5+$j)){ Pop quiz time. What's easier to read, the above or this: while( $k ( ( $i - 1 ) * 5 + $j ) ) { We won't bill you for the whitespace. ;) That is of course assuming that *indiscriminate* padding with spaces increases

RE: Trainset - initial release

2004-02-27 Thread David le Blanc
-Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 6:27 AM To: Gary Stainburn Cc: [EMAIL PROTECTED] Subject: Re: Trainset - initial release On Feb 27, 2004, at 8:32 AM, Gary Stainburn wrote: Hi folks, Howdy. Okay,

RE: Module to pull Netstat summary information?

2004-02-27 Thread David le Blanc
-Original Message- From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 4:00 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Module to pull Netstat summary information? Please bottom post This works however I was hoping perl had a

RE: Module to pull Netstat summary information?

2004-02-27 Thread David le Blanc
-Original Message- From: Michael C. Davis [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 4:37 AM To: [EMAIL PROTECTED] Subject: Re: Module to pull Netstat summary information? Hey, don't forget the end users on windows. At last count there were more than ... well

Re: how to remove an element in an array

2004-02-26 Thread David le Blanc
I always just use this, because I hate removing elements and worrying about it: use strict; use warnings; sub remove_el (\@@) { my $array = shift; my @el_rem; for (sort {$b = $a} @_) { if (! exists $array-[$_]) { warn 'element ', $_, ' does not exist';

RE: Constructors (was: RE: deleting a hash ref's contents)

2004-02-25 Thread David le Blanc
of perl(5) which makes polymorphism possible. Cheers. David le Blanc -- Technical Specialist http://www.identity-solutions.com.au/ I d e n t i t y S o l u t i o n s Level 1 365 Camberwell Road Melbourne Vic 3124 Ph 03 9813 1388 Fax 03 9813 1688 Mobile

RE: Perl Newbie

2004-02-25 Thread David le Blanc
-Original Message- From: WC -Sx- Jones You should probably be castrated for that most incredibly obtuse excuse for help.. You want to get a NEWBIE performing lan sniffing and performing TCP packet decoding as a first attempt at TCP interprocess comms? That's pure nastiness! Now

RE: Perl Newbie

2004-02-25 Thread David le Blanc
-Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Wednesday, 25 February 2004 10:04 PM To: [EMAIL PROTECTED] Subject: Re: Perl Newbie David Le Blanc wrote: -Original Message- From: WC -Sx- Jones You should probably be castrated for that most

RE: Is there an etc. command in perl?

2004-02-25 Thread David le Blanc
-Original Message- From: Joel [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 7:53 AM To: perl Subject: Is there an etc. command in perl? Is there an et cetera type command in perl? Specifically, That's part of the Perl 7 - DWIM spec. You may have to wait until

RE: Pattern matching problem

2004-02-25 Thread David le Blanc
From: Bakken, Luke [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 4:59 AM To: Henry Todd; [EMAIL PROTECTED] Subject: RE: Pattern matching problem I'm having trouble counting the number of specific substrings within a string. I'm working on a bioinformatics coursework at

RE: Count the number of lines in a file without actually iterating through the file

2004-02-25 Thread David le Blanc
-Original Message- From: Jason Normandin [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 10:56 AM To: Perl Beginners Subject: Count the number of lines in a file without actually iterating through the file Hi List. Is there a way to determine the number of

RE: get external process's output *and* return value

2004-02-25 Thread David le Blanc
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 6:56 AM To: [EMAIL PROTECTED] Subject: Re: get external process's output *and* return value Andrew Gaffney wrote: Is there a way to get an external process's output *and*

RE: Perl Newbie

2004-02-25 Thread David le Blanc
LOL ;-) I already apologised for the crack about RPC ... [move along, nothing to see here] -Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 4:48 AM Cc: [EMAIL PROTECTED] Subject: Re: Perl Newbie David le Blanc wrote

RE: PERL on 9.2 and XP Prof.

2004-02-25 Thread David le Blanc
Can anyone comment on ActiveState perl vs Cygwin perl? I've used both and they seem about the same.. except for the confusing paths that cygwin uses. -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 3:03 AM To: 'KENNETH JANUSZ'; 'PERL

RE: get external process's output *and* return value

2004-02-25 Thread David le Blanc
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 1:00 PM To: [EMAIL PROTECTED] Subject: Re: get external process's output *and* return value David Le Blanc wrote: From: John W. Krahn [mailto:[EMAIL PROTECTED] Andrew

RE: Help with end of line charaters

2004-02-23 Thread David le Blanc
-Original Message- From: R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 4:50 PM To: Westcott Andrew-AWESTCO1 Cc: '[EMAIL PROTECTED]' Subject: Re: Help with end of line charaters Westcott Andrew-AWESTCO1 wrote: Hi, I'm new to perl but need to

RE: \r -Option

2004-02-23 Thread David le Blanc
-Original Message- From: Randy W. Sims [mailto:[EMAIL PROTECTED] Sent: Tuesday, 24 February 2004 3:21 AM To: daniel Cc: [EMAIL PROTECTED] Subject: Re: \r -Option On 02/23/04 10:41, daniel wrote: Hi Guys, I'm running the following code under w2k command-line: $| = 1;

RE: substitution

2004-02-23 Thread David le Blanc
-Original Message- From: Hanson, Rob [mailto:[EMAIL PROTECTED] Sent: Tuesday, 24 February 2004 5:43 AM To: 'Olivier Wirz'; [EMAIL PROTECTED] Subject: RE: substitution Is it possible to do this No, at least not the way you are doing it. Something like this will work

RE: parsing Makefiles

2004-02-22 Thread David le Blanc
From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Sunday, 22 February 2004 6:09 PM To: David le Blanc Cc: [EMAIL PROTECTED] Subject: Re: parsing Makefiles David le Blanc wrote: I've come up with some *simple* code that seems to work: #!/usr/bin/perl use strict; use warnings

RE: Help with end of line charaters

2004-02-22 Thread David le Blanc
From: Westcott Andrew-AWESTCO1 [mailto:[EMAIL PROTECTED] Sent: Sunday, 22 February 2004 10:08 PM To: '[EMAIL PROTECTED]' Subject: Help with end of line charaters Hi, I'm new to perl but need to write a script that takes a file and formats lines. The file has to 2 fields that are

RE: parsing Makefiles

2004-02-22 Thread David le Blanc
From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 12:35 AM To: David le Blanc Cc: [EMAIL PROTECTED] Subject: Re: parsing Makefiles David le Blanc wrote: From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Sunday, 22 February 2004 6:09 PM To: David le Blanc

RE: Network Sniffer Module

2004-02-22 Thread David le Blanc
-Original Message- From: Kenton Brede [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 11:52 AM To: Perl Beginners Subject: Re: Network Sniffer Module On Sun, Feb 22, 2004 at 05:59:43PM -0500, Jason Normandin ([EMAIL PROTECTED]) wrote: Hi List. I am looking for a

RE: Network Sniffer Module

2004-02-22 Thread David le Blanc
There has to be a module that does this already!!! Isn't there? Please? I can't find one! Well bugger me. I just found Netpacket on cpan. NetPacket modules to assemble/disassemble network packets at the protocol level. NetPacket-0.04 - 21 May 2003 - Stephanie Wehner If there isn't

RE: struct as an argument of a function

2004-02-22 Thread David le Blanc
I was wondering when to use this ? Not very often, really. I used it recently, and I think that was the first time in many thousands of function calls. On place it is necessary is when dereferencing a function ref [or it could be that I just haven't found a way to accomplish that

RE: parsing Makefiles

2004-02-21 Thread David le Blanc
From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Saturday, 21 February 2004 4:53 PM To: beginners Subject: parsing Makefiles I'm looking to write a script that will parse a toplevel Makefile in a source tree and then descend into all the directories and parse those Makefiles in

RE: $self

2004-02-21 Thread David le Blanc
Would that be ( $me, my$self ) = I ? sorry. is $self a special scalar? actually the simpler solutions is sub my_do_foo { my ($me, $arg, $other) = @_; $me-doOther($arg) unless $other ; ... } but I am fond of 'my $me'

RE: question plz

2004-02-21 Thread David le Blanc
To: Perl Beginners Subject: question plz what is the difference between - and = 0b01 ! man perlobj for '-' and man perldata for '='. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: question plz

2004-02-21 Thread David le Blanc
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, 21 February 2004 2:20 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: question plz They're different operators. = is the same thing as the comma. It's sole difference is readability. For example %hash = (

RE: lc

2004-02-21 Thread David le Blanc
-Original Message- From: Stuart White [mailto:[EMAIL PROTECTED] Sent: Saturday, 21 February 2004 9:21 AM To: Perl Beginners Mailing List Subject: lc I want to take input from STDIN and then convert it to lowercase. so I tried this: lc(chomp($input = STDIN))); and I got an

RE: list of strings to array

2004-02-21 Thread David le Blanc
From: Jenda Krynicky [mailto:[EMAIL PROTECTED] Sent: Saturday, 21 February 2004 10:01 AM To: Perl Beginners Subject: Re: list of strings to array From: Jacob Chapa [EMAIL PROTECTED] Is there any way to split up a string and put it into an array something like this: if I had

RE: parsing Makefiles

2004-02-21 Thread David le Blanc
I've come up with some *simple* code that seems to work: #!/usr/bin/perl use strict; use warnings; $| = 1; my $total = `make -n | wc -l`; my ($count, $line); open MAKE, make |; foreach $line (MAKE) { $count++; my $percent = int(($count / $total) * 100); print

RE: Could I put commands in a variable

2004-02-20 Thread David le Blanc
If you want a fantastic text adventure. try reading the perl source code. [what was that noise Jim?] -Original Message- From: Joel [mailto:[EMAIL PROTECTED] Sent: Friday, 20 February 2004 6:45 AM To: perl Subject: Re: Could I put commands in a variable I'll post the code

RE: Could I put commands in a variable

2004-02-20 Thread David le Blanc
If I was using one specific group of commands, Could I put them inside a variable, then just use the variable when I needed the commands instead of copying and pasting them? i.e. print Hello world; if ($i == 50) { goto MAIN; } elsif ($t == 100) { goto

RE: all matches of a regex-continued

2004-02-20 Thread David le Blanc
In the below link I came across http://www.perl.com/pub/a/2002/06/04/apo5.html?page=8 $_ = abracadabra; @all = m:any /a.*?a/; produces: What version of perl are we talking about here? 5.8 or 6 maybe? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: YA Win32::ODBC question: script hangs on 16th table.

2004-02-19 Thread David le Blanc
Hello... I'm leaving aside the NULL issue for the moment... Is that wise ? :-) Today's project is to get a complete list of column names for each table in the database, and the value for the first record (row) in each table. This code does the right thing for 15 tables

RE: Re: RE: capture a website and process its data

2004-02-19 Thread David le Blanc
Scott E Robinson wrote: Great job, Rob! Thanks for the good code! Quite a timesaver. K Gupta A wrote: wow Rob, thaz a masterpiece code!! 3 cheers for you!! Thanks guys, but I expected a few questions from that post. Please be sure you /understand/ as much as possible before

RE: how do modules work?

2004-02-18 Thread David le Blanc
Andrew Gaffney wrote: I've been using Perl for about a year. I'm writing my own module that contains some custom functions that I use a lot. In doing this, I started wondering how modules work. For example, if my module has 'use SomeModule;' and a script I write has 'use MyModule;',

RE: how do modules work?

2004-02-18 Thread David le Blanc
' will have been exported to your current namespace. Oh, then step 3 kicks in. BTW, if you want parts of this explained in english, feel free to ask :-) Regards, David le Blanc -- Senior Technical Specialist I d e n t i t y S o l u t i o n s Level 1, 369

RE: Flushing FileHandle's Buffer

2004-02-18 Thread David le Blanc
You also have the less obvious $|=1 which sets autoflush to on for the currently selected filehandle. as well as use IO::Handle; FILEHANDLE-autoflush(x) x=0/undef for off, and 1 for on. And again use IO::Handle printflush FILEHANDLE stuff to print; for a print with a built in flush :-)

RE: how do modules work?

2004-02-18 Thread David le Blanc
Do you feel lucky? Again correct, because the module does not *have* to even declare a package. It is free to load stuff into the calling packages namespace (main:: in this case), or even perform actions immediately. I have a silly package which syslog's '$0' and a timestamp to a central

RE: data filtering

2004-02-17 Thread David le Blanc
(GEAE, Foreign National, EACOE) [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 February 2004 11:29 PM To: David le Blanc Subject: RE: data filtering Mr.David, Once again I thank for your valuable suggestion. One more help I need from you. I would like to know how can I make this part

RE: data filtering

2004-02-17 Thread David le Blanc
using the Safe.pm wrapper to make sure the expression runs in a restricted sandbox when it does get run. Cheers. David -Original Message- From: N, Guruguhan (GEAE, Foreign National, EACOE) [mailto:[EMAIL PROTECTED] Sent: Wednesday, 18 February 2004 12:07 AM To: David le Blanc Subject

RE: Chdir doesn't work under Apache?

2004-02-17 Thread David le Blanc
The first three things to note: 1) CHDIR to C: works, CHDIR to UNC paths (//server/what/the/file) cannot and will not. *Map a drive* or use it as a path (ie, direct all commands to '$directories/stuff'. 2) Make sure the user running APACHE as a user, and not 'local system', and make sure

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread David le Blanc
Message- From: Thind, Aman [mailto:[EMAIL PROTECTED] Sent: Wednesday, 18 February 2004 2:18 AM To: David le Blanc Subject: RE: How to su in a script if su needs a pswd ? Thanks David ! The only reason I need to su is that the account I need to su to has write permissions to a drive which my

RE: data filtering

2004-02-16 Thread David le Blanc
; # 15000 y3 3 } [EMAIL PROTECTED] data contains filtered result result. Is that what you were thinking of? Regards, David le Blanc -- Senior Technical Specialist I d e n t i t y S o l u t i o n s Level 1, 369 Camberwell Road, Melbourne, Vic 3124

RE: data filtering

2004-02-16 Thread David le Blanc
given me a way to think further ahead. Further help in this regard is solicited. Thanks Regards Guruguhan EACoE, India. -Original Message- From: David le Blanc [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 6:34 PM To: N, Guruguhan (GEAE, Foreign National, EACOE); [EMAIL

RE: Looking up values in arrays?

2004-02-16 Thread David le Blanc
use List::Util first; sub has_element($$) { my( $aref, $value ) = @_; first { $aref-[$_] eq $value } 0..$#$aref } ? -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Monday, 16 February 2004 10:57 PM To: [EMAIL PROTECTED] Subject: Re: Looking up