Re: displaying ASCII value of character

2004-03-20 Thread Andrew Gaffney
Andrew Gaffney wrote: I have a non-printable character that I'm trying to match in a regex, but I can't figure out what it is. If I know it comes after '~~~' in a string, how can I show its value? I tried: s/~~~(.?)/sprintf "|%d|", $1/se; but that just displays '|0|' which I don't think is righ

RE: How to print like HEX string

2004-03-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
NetSnake wrote: > Hi,all: > I use Perl SNMP module to get server information, but I can not > print ethernet MAC address. > When I use snmpwalk or snmpget program, I get like this: > ifPhysAddress.2 = STRING: 0:e0:ac:b0:c2:1 . > But in Perl, I can not print this string, in consol, p

displaying ASCII value of character

2004-03-20 Thread Andrew Gaffney
I have a non-printable character that I'm trying to match in a regex, but I can't figure out what it is. If I know it comes after '~~~' in a string, how can I show its value? I tried: s/~~~(.?)/sprintf "|%d|", $1/se; but that just displays '|0|' which I don't think is right because it shows as a

Re: extracting data from table embedded in Word document

2004-03-20 Thread Andrew Gaffney
Andrew Gaffney wrote: I'm writing a web-based client information system for a lawyer. His current client list is in a 137 page Word document with an embedded table. I can get it into a somewhat usable format by copying the entire table, pasting into Excel, and saving as tab delimeted text, but t

Re: extracting data from table embedded in Word document

2004-03-20 Thread Andrew Gaffney
R. Joseph Newton wrote: Andrew Gaffney wrote: I'm writing a web-based client information system for a lawyer. [OT} Eek!! Be very, very careful about security, please. I trust your employer has taken "duty of care" isuues into account. [/OT] His current client list is in a 137 page Word docu

RE: Opening files to read, write, etc

2004-03-20 Thread Charles K. Clarkson
Chance Ervin [mailto:[EMAIL PROTECTED] : : : I am trying to open a file, and read the contents, but every : execution gives : me an error: : : cannot open filename: Bad file number : : Below is the program as it stands now. I am guessing that I : have a trailing : something causing the issue

How to print like HEX string

2004-03-20 Thread NetSnake
Hi,all: I use Perl SNMP module to get server information, but I can not print ethernet MAC address. When I use snmpwalk or snmpget program, I get like this: ifPhysAddress.2 = STRING: 0:e0:ac:b0:c2:1 . But in Perl, I can not print this string, in consol, perl print 0 In

Opening files to read, write, etc

2004-03-20 Thread Chance Ervin
Forgot to change the subject on the last email. My apologies. -Original Message- From: Chance Ervin Sent: Saturday, March 20, 2004 7:14 PM To: [EMAIL PROTECTED] Subject: RE: Assistance with Parsing Code I am trying to open a file, and read the contents, but every execution gives me an e

RE: Assistance with Parsing Code

2004-03-20 Thread Chance Ervin
I am trying to open a file, and read the contents, but every execution gives me an error: cannot open filename: Bad file number Below is the program as it stands now. I am guessing that I have a trailing something causing the issue, but I can't seem to put my finger on it. Thanks for the help. =

Re: extracting data from table embedded in Word document

2004-03-20 Thread R. Joseph Newton
Andrew Gaffney wrote: > I'm writing a web-based client information system for a lawyer. [OT} Eek!! Be very, very careful about security, please. I trust your employer has taken "duty of care" isuues into account. [/OT] > His current client list is > in a 137 page Word document with an embedde

Re: Reducing RegEx (pcre)

2004-03-20 Thread WC -Sx- Jones
James Edward Gray II wrote: m/\s+\w+\<(?:[gjyz].*|k\w{3,})\>\w+\s+/ That works great :) ( minus the m of course. ) Thx :) Bill -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Reducing RegEx (pcre)

2004-03-20 Thread James Edward Gray II
On Mar 20, 2004, at 6:17 PM, WC -Sx- Jones wrote: Greetings: Comments about how to perform these 5 checks as ONE TEST are welcome - /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vG /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vJ /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vK /\s+\w+\\w+\s+/ REJECT Invalid HT

RE: extracting data from table embedded in Word document

2004-03-20 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Some of the cells in the table have newlines in them. : Because of this, when it's exported from Excel, the : 2nd line will appear in the correct field, but on a : line by itself: : [snip] : : So it looks like 3 records instead of 2. Does anyone : ha

Reducing RegEx (pcre)

2004-03-20 Thread WC -Sx- Jones
Greetings: Comments about how to perform these 5 checks as ONE TEST are welcome - /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vG /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vJ /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vK /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam vY /\s+\w+\\w+\s+/ REJECT Invalid HTML Spam

extracting data from table embedded in Word document

2004-03-20 Thread Andrew Gaffney
I'm writing a web-based client information system for a lawyer. His current client list is in a 137 page Word document with an embedded table. I can get it into a somewhat usable format by copying the entire table, pasting into Excel, and saving as tab delimeted text, but this has its problems.

Re: using DBI to form query with variables that have quotes

2004-03-20 Thread Andrew Gaffney
Wiggins d'Anconia wrote: Andrew Gaffney wrote: WC -Sx- Jones wrote: Andrew Gaffney wrote: INSERT INTO people VALUES(NULL, "Firstname", "Lastname", ""123 Anywhere Address"", ..."); INSERT INTO people VALUES(NULL, "Firstname", "Lastname", '123 O'Walley Street', ..."); See the problem? I can't u

Re: better one liner for variable's value assignment

2004-03-20 Thread John W. Krahn
"John W. Krahn" wrote: > > "Jupiterhost.Net" wrote: > > > > John W. Krahn wrote: > > > > > > This will work if param('xid') returns anything but undef: > > > > > > my ( $xid ) = param( 'xid' ) =~ /(^\d+$|)/; > > > > I like that, good idea. It is possible it may be undef though, doh! > > If it is

Re: better one liner for variable's value assignment

2004-03-20 Thread John W. Krahn
"Jupiterhost.Net" wrote: > > John W. Krahn wrote: > > > > This will work if param('xid') returns anything but undef: > > > > my ( $xid ) = param( 'xid' ) =~ /(^\d+$|)/; > > I like that, good idea. It is possible it may be undef though, doh! If it is and you have warnings enabled (you DO have war

Re: better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
John W. Krahn wrote: "Jupiterhost.Net" wrote: Howdy, Hello, I'm looking to have a one liner version of this: my $xid = ''; $xid = param('xid') if param('xid') =~ m/^\d+$/; Basically, if the param is numeric then assign it to $xid, other wise '' (IE empty but declared) Some thing like: my $xi

Re: better one liner for variable's value assignment

2004-03-20 Thread John W. Krahn
"Jupiterhost.Net" wrote: > > Howdy, Hello, > I'm looking to have a one liner version of this: > > my $xid = ''; > $xid = param('xid') if param('xid') =~ m/^\d+$/; > > Basically, if the param is numeric then assign it to $xid, other wise '' > (IE empty but declared) Some thing like: > > my $xi

Re: better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
Paul Johnson wrote: On Sat, Mar 20, 2004 at 03:10:18PM -0600, JupiterHost.Net wrote: Howdy, I'm looking to have a one liner version of this: my $xid = ''; $xid = param('xid') if param('xid') =~ m/^\d+$/; Basically, if the param is numeric then assign it to $xid, other wise '' (IE empty but d

Re: better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
James Edward Gray II wrote: On Mar 20, 2004, at 3:10 PM, JupiterHost.Net wrote: Howdy, I'm looking to have a one liner version of this: Why? Do you win a cookie if you do it in one line? ;) Not so much a cookie as some sugar :) I win cookies at work for writing clear code, which often inv

Re: better one liner for variable's value assignment

2004-03-20 Thread Paul Johnson
On Sat, Mar 20, 2004 at 03:10:18PM -0600, JupiterHost.Net wrote: > Howdy, > > I'm looking to have a one liner version of this: > > my $xid = ''; > $xid = param('xid') if param('xid') =~ m/^\d+$/; > > Basically, if the param is numeric then assign it to $xid, other wise '' > (IE empty but declar

Re: better one liner for variable's value assignment

2004-03-20 Thread James Edward Gray II
On Mar 20, 2004, at 3:10 PM, JupiterHost.Net wrote: Howdy, I'm looking to have a one liner version of this: Why? Do you win a cookie if you do it in one line? ;) I win cookies at work for writing clear code, which often involves more than one line. my $xid = ''; $xid = param('xid') if param(

better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
Howdy, I'm looking to have a one liner version of this: my $xid = ''; $xid = param('xid') if param('xid') =~ m/^\d+$/; Basically, if the param is numeric then assign it to $xid, other wise '' (IE empty but declared) Some thing like: my $xid = param('xid') if param('xid') =~ m/^\d+$/ || ''; But

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
In this case, $func holds a "hard reference", not a "soft reference". The strict pragma only blocks the latter. Here's a simple example: sub howdy { print "Howdy!\n"; } my $func = \&howdy;# hard reference $func->();# fine, even with strictures $func = 'howdy';# soft referen

Re: using DBI to form query with variables that have quotes

2004-03-20 Thread Wiggins d'Anconia
Andrew Gaffney wrote: WC -Sx- Jones wrote: Andrew Gaffney wrote: INSERT INTO people VALUES(NULL, "Firstname", "Lastname", ""123 Anywhere Address"", ..."); INSERT INTO people VALUES(NULL, "Firstname", "Lastname", '123 O'Walley Street', ..."); See the problem? I can't use either quoting consiste

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread James Edward Gray II
On Mar 20, 2004, at 1:20 PM, JupiterHost.Net wrote: Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs';

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
JupiterHost.Net wrote: Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs';" or "refs" or something ,

use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs';" or "refs" or something , and have it not cause an e

Re: using DBI to form query with variables that have quotes

2004-03-20 Thread Andrew Gaffney
WC -Sx- Jones wrote: Andrew Gaffney wrote: INSERT INTO people VALUES(NULL, "Firstname", "Lastname", ""123 Anywhere Address"", ..."); INSERT INTO people VALUES(NULL, "Firstname", "Lastname", '123 O'Walley Street', ..."); See the problem? I can't use either quoting consistently due to the nature

RE: modification and inode change times

2004-03-20 Thread Chance Ervin
http://sourceforge.net/projects/filewatch/ This does what your looking for and much more. It will tell you what changes inside the file have taken place. - InteleNet Communications Inc. "Help me help you." Chance Ervin - SCSA --Jerry Magu

modification and inode change times

2004-03-20 Thread DBSMITH
All, was hoping to get some ideas on what to use to get all, if any files have been modified and if so give the file names and dates for these changed files? If any files were modified more than once then I need to output the filenames and the date/time as well for that n amount of times.

Re: using DBI to form query with variables that have quotes

2004-03-20 Thread Wiggins d'Anconia
WC -Sx- Jones wrote: Andrew Gaffney wrote: INSERT INTO people VALUES(NULL, "Firstname", "Lastname", ""123 Anywhere Address"", ..."); INSERT INTO people VALUES(NULL, "Firstname", "Lastname", '123 O'Walley Street', ..."); See the problem? I can't use either quoting consistently due to the nature

Re: Setting a Perl Environmental Variable on Boot-Up

2004-03-20 Thread WC -Sx- Jones
George Yolland wrote: John> Is there a way on a Linux machine to set some environmental John> variables Is there a similar way to do this in perl. I'm concerned with running as cron jobs where the environment is limited. Is it true that everything is already on the Internet? http://www.devdai

Re: Setting a Perl Environmental Variable on Boot-Up

2004-03-20 Thread George Yolland
Randal L. Schwartz wrote: "John" == John Kent <[EMAIL PROTECTED]> writes: John> Is there a way on a Linux machine to set some environmental John> variables I have a related question. In a bash script I can source a file to the environment. Like . .profile Is there a similar way to do this in

Re: Creating Menus in CGI

2004-03-20 Thread WC -Sx- Jones
Mike Ni wrote: http://search.cpan.org/~lds/CGI.pm-3.04/CGI.pm Also, see: http://modperl.com:9000/hangman.html Bill -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: "perl -i..." reminder?

2004-03-20 Thread Peter Scott
In article <[EMAIL PROTECTED], [EMAIL PROTECTED] (Chris McMahon) writes: > >Hello...=20 > I need to add some boilerplate text to the very top of about >17,000 files. I can get to the files easily enough (File::Find), but >there's a special syntax to edit a file in place, and it's not specif