Re: PERL code execution rule?

2003-09-09 Thread R. Joseph Newton
Paul Kraus wrote: > > > > > > As a side note Where is the best place to put the subroutines? > > After the exit command or in the beginning of the script? Any > > preferences? > I prefer sticking them in the bottom in the order they are called. > > This way when I open a script at a glance I

Re: PERL code execution rule?

2003-09-09 Thread R. Joseph Newton
James Edward Gray II wrote: > Almost. You have to declare them before you use them if you want to > leave of the parenthesis. :) > > James Actually, it is vice-versa. If you use prototypes, then the prototype must be declared before any call to the function. In that case, you will have a para

Re: PERL code execution rule?

2003-09-09 Thread R. Joseph Newton
George Schlossnagle wrote: > On Tuesday, September 9, 2003, at 10:59 AM, Rodney Wise wrote: > > > > It looks like by declaring my subroutines, they are being executed. ??? > > > > example of my Subroutine declarations: > > > > > > > > # Get the Data Number > > &get_number; > > > > # Get Form Info

Re: PERL code execution rule?

2003-09-09 Thread R. Joseph Newton
Rodney Wise wrote: > George, > > # Get the Data Number > &get_number; Avoid using the &function_name until you are a Perl expert, and know exactly why you are using it. That is a call to the subroutine, but not the one to be used under normal circumstances. > # Get Form Information > &parse_for

Help on processinf Date String.

2003-09-09 Thread Pandey Rajeev-A19514
Hi , I have to start with input as date string which I need to process. $date1 = "Wed Sep 10 15:51:50 CST 2003"; $date2 = "15:52:00.885 cst Wed Sep 10 2003"; I have to find the difference in between the two dates. Which is the best module to do that and probably a sample code would do more help.

Re: FW: A big trouble

2003-09-09 Thread R. Joseph Newton
Gavin Laking wrote: > On Mon, 08 Sep 2003 23:58:16 -0700 > [EMAIL PROTECTED] (R. Joseph Newton) wrote: > > > I'm sticking with my guns here. Extended passages of sequential code > > are the breeding grounds for errors. They become progressively more > > difficult to debug. As needs change, such

Re: PERL code execution rule?

2003-09-09 Thread R. Joseph Newton
Rodney Wise wrote: > I was under the impression that "subroutines" are only executed IF they're > called. But, it looks like subroutines will execute on there own if they > are written in the beginning part of the PERL code and before other code > takes over the codes sequence of events. In oth

Re: Replacing variable data between fields

2003-09-09 Thread perlwannabe
> On Tuesday, September 9, 2003, at 08:58 PM, perlwannabe wrote: > >> I know it involves using the s/// operator to both strip the tabs and >> replace with but the problem is that it requires using an array >> for >> each address...and that is what is creating problems for me. >> >> Thanks... >

Re: pls do reply

2003-09-09 Thread R. Joseph Newton
Vema Venkata wrote: > #!/proj/ahd02/CAisd/ActivePerl-5.6.0.618/bin/perl > #/usr/local/bin/perl > > use POSIX qw(strftime); > > $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime; Huh? What is happening here. Your subject line whines for a response, and yet in your code you totally disreg

Re: Replacing variable data between fields

2003-09-09 Thread perlwannabe
>> I know it involves using the s/// operator to both strip the tabs and >> replace with but the problem is that it requires using an array >> for each address...and that is what is creating problems for me. > > > s{ (?<=Address:\t) (.+?) (?=\tCity:) } > { ( $a = $1 ) =~ tr/\t/ /; $a }ex;

Re: question re: Function Templates

2003-09-09 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > > Another samll problem, if this was used for generating web content, is the > choice of embedded quote operators. At least on my installation, the > apostrophes remain apostrophes.. Spoke too soon, I guess. The browser doesn't seem to mind single quotes at all, at l

Re: question re: Function Templates

2003-09-09 Thread R. Joseph Newton
Jenda Krynicky wrote: > From: sfryer <[EMAIL PROTECTED]> > > I'm reading perldoc perlref right now and under the Function Templates > > section, I've come across something that's got me stumped. The code in > > question is as follows... > > > >@colors = qw(red blue green yellow orange purple v

Re: Replacing variable data between fields

2003-09-09 Thread John W. Krahn
Perlwannabe wrote: > > I have a text file that has various addresses in different formats. I > need to remove any items that are not part of the address so the output is > standard. Here is an example of the input file: > > Address:1234MockingbirdLaneCity:GrotonState:CT > Address:2933Hummingbir

Re: Replacing variable data between fields

2003-09-09 Thread James Edward Gray II
On Tuesday, September 9, 2003, at 09:26 PM, James Edward Gray II wrote: Hmm, let me think out loud a little. I think I see a pattern, so let's first change all of them to spaces. That's easy enough: s/\t/ /g; Obviously it was more out loud than thinking. ;) Let's change that to the better:

Re: Replacing variable data between fields

2003-09-09 Thread James Edward Gray II
On Tuesday, September 9, 2003, at 08:58 PM, perlwannabe wrote: I have a text file that has various addresses in different formats. I need to remove any items that are not part of the address so the output is standard. Here is an example of the input file: Address:1234MockingbirdLaneCity:Grot

Re: eval parameters one liner

2003-09-09 Thread R. Joseph Newton
"John W. Krahn" wrote: > > > Try it like this: > > > > > > perl -le 'print eval "@ARGV"' > > > > Good on 'nix/'nux, I guess. On Windows, It takes a little different quoting: > > You mean like: > > perl -le "print eval [EMAIL PROTECTED]" > > > Greetings! E:\d_drive\perlStuff>perl -le "print eval $

Replacing variable data between fields

2003-09-09 Thread perlwannabe
I have a text file that has various addresses in different formats. I need to remove any items that are not part of the address so the output is standard. Here is an example of the input file: Address:1234MockingbirdLaneCity:GrotonState:CT Address:2933HummingbirdSt.City:GrotonState:CT Address:43

Re: checking for no input

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, david said: >Jeff 'Japhy' Pinyan wrote: > >> I really that's too much work. The -t file test should be sufficient: > >your version only checks to see is STDIN is attached to a tty. for example, >run your script from a crontab and you see will it never prints the usage. >(ie, it always t

Re: checking for no input

2003-09-09 Thread david
Jeff 'Japhy' Pinyan wrote: > On Sep 9, Kevin Pfeiffer said: > >>In article <[EMAIL PROTECTED]>, David wrote: >> >>[...] >>> [panda]$ html.pl >>> no input >>> [panda]$ html.pl file.html >>> get file file.html >>> [panda]$ echo "hi" | html.pl >>> get line hi >>> [panda]$ >>> >>> perldoc -f select >

Re: checking for no input

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, Kevin Pfeiffer said: >In article <[EMAIL PROTECTED]>, David wrote: > >[...] >> [panda]$ html.pl >> no input >> [panda]$ html.pl file.html >> get file file.html >> [panda]$ echo "hi" | html.pl >> get line hi >> [panda]$ >> >> perldoc -f select >> perldoc IO::Select > >Thanks! This is what

Re: perl questions / exercices

2003-09-09 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Ged wrote: > Hi all, > > I am currently learning perl reading all the material I can get my hands > on, but have no use for it on a daily basis. > > Because of this I am not getting the practice I need on a day-to-day basis > to gain more knowledge. > > Having co

Re: File::Find Laments

2003-09-09 Thread John W. Krahn
Stephen wrote: > > In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > wrote > > > > use strict; > > use warnings; > > use File::Find; > > > > my $file_count = 0; > > my $dir_count = 0; > > > > find (\&wanted, "C:/SomeFolder"); > > > > sub wanted { > > if (-d) { > > return unless /

Re: checking for no input

2003-09-09 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, David wrote: [...] > [panda]$ html.pl > no input > [panda]$ html.pl file.html > get file file.html > [panda]$ echo "hi" | html.pl > get line hi > [panda]$ > > perldoc -f select > perldoc IO::Select Thanks! This is what I was thinking of; I'll take a look. -- K

RE: version control and tracking?

2003-09-09 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Bob Showalter wrote: > Kevin Pfeiffer wrote: >> I occasionally see things in a script such as: >> # $Id$ >> >> I assume this is for some sort of automated version >> identification? I use >> use cvs, but end up having to change version/rev. nos. within >> scripts/f

Re: install modules in winXP

2003-09-09 Thread John W. Krahn
Shiping Wang wrote: > > Hello, Hello, > When I try to install modules from CPAN to my Window XP followed by > perl Makefile.PL > nmake > nmake test > nmake install > > Most time installation is OK, but sometime I get following message after > "nmake": > > 'cl' is not recognized as an internal

Re: Is $data binary or ascii?

2003-09-09 Thread John W. Krahn
James Edward Gray II wrote: > > On Tuesday, September 9, 2003, at 01:28 PM, Dan Muey wrote: > > > Looks like it's a Posix thing added in 5.8.0 which is cool and can be > > written as > > [:^ascii:] > > Instead of [^[:ascii:]] > > > > Very cool, although it only works on my 5.8.0 and not 5.0 > >

RE: Parsing URL

2003-09-09 Thread Paul Kraus
perldoc CGI use CGI; my $cgi = new CGI; my $genre = $cgi -> param ('genre'); Also check search.cpan.org -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 4:31 PM To: [EMAIL PROTECTED] Subject: Parsing URL How do I go about parsin

RE: Parsing URL

2003-09-09 Thread Wiggins d'Anconia
On Tue, 09 Sep 2003 16:31:17 -0400, [EMAIL PROTECTED] wrote: > How do I go about parsing a url from the browser location. For example if I have the > following url: > > https://mercedissa.tmo.org/cgi-bin/req/sreq_start.pl?sid=EBSCO:buh%20(Via%20S

RE: install modules in winXP

2003-09-09 Thread Paul Kraus
Install the activestate version of perl 5.8 and then use there ppm utitily. It will do all the work for you. www.activestate.com -Original Message- From: Shiping Wang [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 4:32 PM To: [EMAIL PROTECTED] Subject: install modules in wi

Parsing URL

2003-09-09 Thread Mercedissa1
How do I go about parsing a url from the browser location. For example if I have the following url: https://mercedissa.tmo.org/cgi-bin/req/sreq_start.pl?sid=EBSCO:buh%20(Via%20SFX)&genre=article&issn=00999660&volume=242&issue=26&date=2003&atitle=S.O.S.%20Africa.&title=Wall%20Street%20Journal%20-%

RE: script to enumerate window services

2003-09-09 Thread Messenger, Mark
On the off chance this has been missed: use Win32::Service; $host=shift; Win32::Service::GetServices($host,\%hashref); foreach $key (sort keys %hashref) {print "Service: $hashref{$key} \tDescription: $key\n";} -Original Message- From: Leon [mailto:[EMAIL PROTECTED]

install modules in winXP

2003-09-09 Thread Shiping Wang
Hello, When I try to install modules from CPAN to my Window XP followed by perl Makefile.PL nmake nmake test nmake install Most time installation is OK, but sometime I get following message after "nmake": 'cl' is not recognized as an internal or external command, operable program or batch file.

Re: PERL code execution rule?

2003-09-09 Thread Wiggins d'Anconia
On Tue, 9 Sep 2003 12:28:42 -0400, "Rodney Wise" <[EMAIL PROTECTED]> wrote: > Thanks everyone for your help. > > I'm working on a PERL script for the "WWWboard" originally written by Matt > Wright. PERL isn't my primary language (as I'm sure you

Repost : Using Flock under IRIX, Solaris and Linux with Perl

2003-09-09 Thread James Amrhein
Hi, I'm trying to get flock to behave consistently between IRIX,Solaris and Linux (2.4.x). When I run the following Perl Program, IRIX and Solaris allows the Shared lock (and doesn't execute the inside of the while loop) Where as, Linux denies the Shared lock with "Resource temporarily una

RE: $] variable

2003-09-09 Thread mdaily
>perl -e print "-v-"; windows =>This is perl, v5.8.0 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Madison Daily Weldon, Williams & Lick, Inc. (479) 784-2109 (Ext. 431) [EMAIL PROTECTED] #

RE: ? about this NG speed.

2003-09-09 Thread Paul Kraus
Don't waste your time. I tried to use the ng for a month and it was simply unusable unless you don't mind being 4 to 12 hours behind which basically means you can't help anyone and you better not be pressed for help yourself. -Original Message- From: Rodney Wise [mailto:[EMAIL PROTECTED]

RE: $] variable

2003-09-09 Thread Dan Muey
Thanks! > -Original Message- > From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 09, 2003 2:56 PM > To: Dan Muey; [EMAIL PROTECTED] > Subject: RE: $] variable > > > perl -e 'print "-$]-\n"'; > -5.006001- > > This is perl, v5.6.1 built for sun4-solaris > http

RE: $] variable

2003-09-09 Thread Dan Muey
Thanks! > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 09, 2003 2:58 PM > To: Dan Muey; [EMAIL PROTECTED] > Subject: RE: $] variable > > > Dan Muey wrote: > > I'm using the $] (perl version) variable and was wondering > what print > > "

RE: $] variable

2003-09-09 Thread Dan Muey
> Dan, > Here's the output from two machines here, a Win XP box, and > an AIX 5.1 box. > > Hope it's useful to you. > > Tony Thanks Tony! > > > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > C:\>perl -e 'print "-$]-";' > Unrecognized switch: -$]-;'

RE: $] variable

2003-09-09 Thread Bob Showalter
Dan Muey wrote: > I'm using the $] (perl version) variable and was wondering what print > "-$]-"; Would output on a 5.6.n or 5.8.n verison of perl where n is > greater than 0 Anyone with those versions could you run: > perl -e 'print "-$]-";' > And send the results to me? $ perl -V:version -e 'pri

RE: $] variable

2003-09-09 Thread Wiggins d'Anconia
perl -e 'print "-$]-\n"'; -5.006001- This is perl, v5.6.1 built for sun4-solaris http://danconia.org On Tue, 9 Sep 2003 15:48:38 -0400, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > 5.8.0 > > > -5.008- > > -Original Message- > From: Dan Mu

RE: $] variable

2003-09-09 Thread Dan Muey
Thanks! Paul > -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 09, 2003 2:49 PM > To: Dan Muey; [EMAIL PROTECTED] > Subject: RE: $] variable > > > 5.8.0 > > > -5.008- > > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED]

RE: ? about this NG speed.

2003-09-09 Thread Tim Johnson
If you're viewing it through the newsgroup it might be quicker to use the mailing list. If you have a client like Outlook that can sort by Conversation (or topic, or whatever your client calls it), then you can use it pretty much like a news reader. -Original Message- From: Rodney Wise [

RE: PERL code execution rule?

2003-09-09 Thread Tim Johnson
I think maybe what you're thinking of when you say subroutines can be "declared" is subroutine prototyping. Check out this article that has a pretty good explanation: http://wdvl.internet.com/Authoring/Languages/Perl/ProPerl/properl3-1.html -Original Message- From: Rodney Wise [mailto:[E

RE: $] variable

2003-09-09 Thread Paul Kraus
5.8.0 -5.008- -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 3:40 PM To: [EMAIL PROTECTED] Subject: $] variable I'm using the $] (perl version) variable and was wondering what print "-$]-"; Would output on a 5.6.n or 5.8.n verison of per

RE: PERL code execution rule?

2003-09-09 Thread Paul Kraus
I prefer sticking them in the bottom in the order they are called. This way when I open a script at a glance I can see the main logic and then as need be move into the subs. -Original Message- From: Rodney Wise [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 12:29 PM To: [EMA

Can't locate auto/Win32/GetOSName.al in @INC. Any information??

2003-09-09 Thread Price, Mark
I'm trying to use the WIN32::PRINTER module. It was loaded with PPM without a problem. When I run a simple test, I get the following: Can't locate auto/Win32/GetOSName.al in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/Printer.pm line 81. I've looked at the WIN32 mod

? about this NG speed.

2003-09-09 Thread Rodney Wise
I've noticed that it sometimes takes a few hours before my post appear on this NG (the one I sent before this one is already 4 hours and it still hasn't showed up). I was wondering if this is common for this NG or is it simply my experience? I am posting this one at 2:52 PM EST on 9-9-03 -- ...

Re: File::Find Laments

2003-09-09 Thread Stephen
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote > > "Stephen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I'm doing my best but having a lot of trouble understanding the > > documentation for File::Find. After seeing a number of people being > > yelled at for trying to reinve

Re: PERL code execution rule?

2003-09-09 Thread Rodney Wise
Thanks everyone for your help. I'm working on a PERL script for the "WWWboard" originally written by Matt Wright. PERL isn't my primary language (as I'm sure you all can see) ... although I'm finding it very powerful and useful. Apparently, Matt used a lot of global variables in his subroutines.

$] variable

2003-09-09 Thread Dan Muey
I'm using the $] (perl version) variable and was wondering what print "-$]-"; Would output on a 5.6.n or 5.8.n verison of perl where n is greater than 0 Anyone with those versions could you run: perl -e 'print "-$]-";' And send the results to me? TIA Dan -- To unsubscribe, e-mail: [EMAIL PROTEC

RE: Is $data binary or ascii?

2003-09-09 Thread Dan Muey
> On Tuesday, September 9, 2003, at 01:28 PM, Dan Muey wrote: > > > Looks like it's a Posix thing added in 5.8.0 which is cool > and can be > > written as > > [:^ascii:] > > Instead of [^[:ascii:]] > > > > Very cool, although it only works on my 5.8.0 and not 5.0 > > (I don't have a 5.6 ish anyo

Re: Is $data binary or ascii?

2003-09-09 Thread James Edward Gray II
On Tuesday, September 9, 2003, at 01:28 PM, Dan Muey wrote: Looks like it's a Posix thing added in 5.8.0 which is cool and can be written as [:^ascii:] Instead of [^[:ascii:]] Very cool, although it only works on my 5.8.0 and not 5.0 (I don't have a 5.6 ish anyone know when the Posix support wa

RE: Is $data binary or ascii?

2003-09-09 Thread Dan Muey
> > Dan Muey wrote: > > > > > > Anyone know where is the [:ascii:] class/group/whatever > you call it > > > documented? > > > > perldoc perlre > > Thanks I'll have a look then! Looks like it's a Posix thing added in 5.8.0 which is cool and can be written as [:^ascii:] Instead of [^[:ascii:]]

RE: Is $data binary or ascii?

2003-09-09 Thread Dan Muey
> Dan Muey wrote: > > > > Anyone know where is the [:ascii:] class/group/whatever you call it > > documented? > > perldoc perlre Thanks I'll have a look then! > > > John > -- > use Perl; > program > fulfillment > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands,

Re: Is $data binary or ascii?

2003-09-09 Thread John W. Krahn
Dan Muey wrote: > > Anyone know where is the [:ascii:] class/group/whatever you call it documented? perldoc perlre John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: PERL code execution rule?

2003-09-09 Thread John W. Krahn
Paul Kraus wrote: > > That's interesting. I have also read that you need to have the subs at > the top of the script if you call it with sub() > > However I just realized that I always have my subs at the bottom and > always call them with sub() without the ampersand. > > Am I getting lucky? Sho

RE: Is $data binary or ascii?

2003-09-09 Thread Dan Muey
> Dan Muey wrote: > > > > Say I have a variable $data that has file contents in it. > > Is there a way to tell if it is binary or ascii? > > > > if($data =~ ???) { print "It is binary w"; } > > elsif($data =~ ???) { print "It is ascii woo hoo"; } > > else { print "I do not know what it is, do

Mod Perl 1

2003-09-09 Thread Paul Kraus
I am trying to make mod perl one and keep getting the following error. Paul perl Makefile.PL APACHE_SRC=../apache_1.3.28/src APACHE_PREFIX=/srv/www DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 Make r.o): In function `Perl_reentrant_retry': reentr.o(.text+0x67b): undefined reference to `gethostent_r'

Re: PERL code execution rule?

2003-09-09 Thread James Edward Gray II
On Tuesday, September 9, 2003, at 12:57 PM, Paul Kraus wrote: That's interesting. I have also read that you need to have the subs at the top of the script if you call it with sub() Almost. You have to declare them before you use them if you want to leave of the parenthesis. :) James -- To un

Re: Is $data binary or ascii?

2003-09-09 Thread John W. Krahn
Dan Muey wrote: > > Say I have a variable $data that has file contents in it. > Is there a way to tell if it is binary or ascii? > > if($data =~ ???) { print "It is binary w"; } > elsif($data =~ ???) { print "It is ascii woo hoo"; } > else { print "I do not know what it is, doh!"; } if ( $d

RE: PERL code execution rule?

2003-09-09 Thread Paul Kraus
That's interesting. I have also read that you need to have the subs at the top of the script if you call it with sub() However I just realized that I always have my subs at the bottom and always call them with sub() without the ampersand. Am I getting lucky? Should I correct my scripts? Paul --

Re: PERL code execution rule?

2003-09-09 Thread John W. Krahn
Rodney Wise wrote: > > I was reviewing my code some more and here is what I think might be > happening. > > In my code, the first thing I do is declare my variables. > > Then I declare my subroutines'. > > It looks like by declaring my subroutines, they are being executed. ??? > > example of m

Re: labeled blocks

2003-09-09 Thread John W. Krahn
Dan Muey wrote: > > > Thomas Browner wrote: > > > > > > Could some one show me an example of a labeled block (goto)? > > > > perlsyn.pod has many examples of labeled blocks > > > > perldoc perlsyn > > This thread got me thinking. "Thread"? Since your MUA doesn't provide a "References:" header i

Re: checking for no input

2003-09-09 Thread david
Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, John W. Krahn wrote: > >> "R. Joseph Newton" wrote: >>> >>> Kevin Pfeiffer wrote: >>> >>> > I'm looking at HTML::TokeParser. It expects a scalar with a filename >>> > or a reference to a scalar containing the data to parse. >>> > >>> > Thi

RE: Is $data binary or ascii?

2003-09-09 Thread Dan Muey
> On Sep 9, Dan Muey said: > > >> if -T $data > >> if -B $data > > > >I never thought of using the file test operators on variables! > > I'm not so sure you can. But the docs say that -B looks for I was afraid of that. After trying it out I couldn't get any good results. > at least

Re: File::Basename

2003-09-09 Thread Rob Dixon
Paul Kraus wrote: > > From how I understood it file::basename was able to tell figure out the > filename without path for both windows and UNIX. > I have an html page that has a form field for uploading a file. When I > hit the choose button it lets me pick something from my directory. Now > the fi

RE: Is $data binary or ascii?

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, Dan Muey said: >> if -T $data >> if -B $data > >I never thought of using the file test operators on variables! I'm not so sure you can. But the docs say that -B looks for at least 30% of the characters to be control-chars or high-bit chars. So I'd suggest: sub is_binary_d

RE: Cgi upload

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, Paul Kraus said: >I have one question though using the while ( <$fh> ) >Works great. Is there a reason I would want to do while (read ( $fh, >$buffer, $buffer_size) If you want to read the optimal number of bytes at a time. In a simple application, there's really no reason to do one ov

Re: File::Find Laments

2003-09-09 Thread Rob Dixon
"Stephen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm doing my best but having a lot of trouble understanding the > documentation for File::Find. After seeing a number of people being > yelled at for trying to reinvent the wheel by writing their own > functions, I'm resigned

RE: Is $data binary or ascii?

2003-09-09 Thread Dan Muey
> if -T ("looks like text file") > If -B ("looks like binary file") > > if -T $data > if -B $data > > HTH Definitely! Thanks Paul. I never thought of using the file test operators on variables! Cool. Thanks! > Paul > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTE

RE: Is $data binary or ascii?

2003-09-09 Thread Paul Kraus
if -T ("looks like text file") If -B ("looks like binary file") if -T $data if -B $data HTH Paul -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 11:57 AM To: [EMAIL PROTECTED] Subject: Is $data binary or ascii? Say I have a variab

RE: script to enumerate window services

2003-09-09 Thread Conor Lillis
This will list all services, and email them to you. -Original Message- From: Brown, Bobby (US - Hermitage) [mailto:[EMAIL PROTECTED] Sent: 09 September 2003 16:24 To: 'Leon'; perl; Yahoo Beginner Perl; win32 Subject: RE: script to enumerate window services Various scripts here I use to g

Is $data binary or ascii?

2003-09-09 Thread Dan Muey
Say I have a variable $data that has file contents in it. Is there a way to tell if it is binary or ascii? if($data =~ ???) { print "It is binary w"; } elsif($data =~ ???) { print "It is ascii woo hoo"; } else { print "I do not know what it is, doh!"; } TIA Dan -- To unsubscribe, e-mail: [E

RE: Cgi upload

2003-09-09 Thread Paul Kraus
Ok Jeff fixed me right up. I was following along with the cgi programming oriely book. I was over thinking it and not really looking at what was going on. I have one question though using the while ( <$fh> ) Works great. Is there a reason I would want to do while (read ( $fh, $buffer, $buffer_s

RE: Cgi upload

2003-09-09 Thread Dan Muey
> This should be a simple little script. > > But it errors out every time. > > Query: > test.cgi?fname=&lname=&file=C%3A%5CDocuments+and+Settings%5Cpd > k%5CDeskto > p%5Cascii-full.gif > > Scrpit > -- > #!/usr/bin/perl -wT > > use strict; > use warnings; > use CGI; > use constant BUFFER_S

Re: Cgi upload

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, Paul Kraus said: >Query: >test.cgi?fname=&lname=&file=C%3A%5CDocuments+and+Settings%5Cpdk%5CDeskto >p%5Cascii-full.gif That's not a file upload. That's a simple get query. A query with a file upload takes place over POST, not GET. Furthermore, you need to specify the encoding type in

RE: script to enumerate window services

2003-09-09 Thread Brown, Bobby (US - Hermitage)
Various scripts here I use to gather information from remote servers Bobby -Original Message- From: Leon [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 8:53 AM To: perl; Yahoo Beginner Perl; win32 Subject: script to enumerate window services Hi everyone, Does anyone know h

Cgi upload

2003-09-09 Thread Paul Kraus
This should be a simple little script. But it errors out every time. Query: test.cgi?fname=&lname=&file=C%3A%5CDocuments+and+Settings%5Cpdk%5CDeskto p%5Cascii-full.gif Scrpit -- #!/usr/bin/perl -wT use strict; use warnings; use CGI; use constant BUFFER_SIZE => 16_384; my $cgi = new CGI; my

RE: PERL code execution rule?

2003-09-09 Thread Dan Muey
> George, > > Thanks for the quick response. > > I was reviewing my code some more and here is what I think > might be happening. > > In my code, the first thing I do is declare my variables. > > Then I declare my subroutines'. > > It looks like by declaring my subroutines, they are being >

Re: pls do reply

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, Vema Venkata said: >How do i get the process id into a variable ? > >$pid = qx(ps -f|grep srvtst26); > print "Server Started : $pid \n qx() returns the output. You want to use open(): $pid = open PS, "ps -f | grep srvtst26 |" or die "'ps -f | grep srvtst26' error: $!"; You can

Re: PERL code execution rule?

2003-09-09 Thread George Schlossnagle
On Tuesday, September 9, 2003, at 10:59 AM, Rodney Wise wrote: It looks like by declaring my subroutines, they are being executed. ??? example of my Subroutine declarations: # Get the Data Number &get_number; # Get Form Information &parse_form; Just to be sure we're on the same playing field -

Re: checking for no input

2003-09-09 Thread Jeff 'japhy' Pinyan
On Sep 9, R. Joseph Newton said: >> >> Kevin Pfeiffer wrote: >> >> >> >> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or >> >> > a reference to a scalar containing the data to parse. > >Not the provlem at all, Kevin. The problem is those damned extra >operators, in this

RE: PERL code execution rule?

2003-09-09 Thread Paul Kraus
You are not declaring them here. You are calling them. &subroutine call that subroutine. There is no reason to declare them like this. Is the same as &subroutine (item1, item2) or subroutine(item1, item2) Actually there is a difference that someone else can explain. But there is no reason to "de

Re: PERL code execution rule?

2003-09-09 Thread Rodney Wise
George, Thanks for the quick response. I was reviewing my code some more and here is what I think might be happening. In my code, the first thing I do is declare my variables. Then I declare my subroutines'. It looks like by declaring my subroutines, they are being executed. ??? example of my

RE: perl error

2003-09-09 Thread Hanson, Rob
I have no hard answers, but here are some suggestions from my admin... I'd look to see which DBD connector he's trying to use. He's also using a multi-threaded perl which I believe is buggy under Solaris -- especially perl 5.6. I'd try re-compiling perl 5.8 and check that the DBD modules are ins

Re: checking for no input

2003-09-09 Thread R. Joseph Newton
Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, John W. Krahn wrote: > > > "R. Joseph Newton" wrote: > >> > >> Kevin Pfeiffer wrote: > >> > >> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or > >> > a reference to a scalar containing the data to parse. > >> > > >>

Re: PERL code execution rule?

2003-09-09 Thread George Schlossnagle
On Tuesday, September 9, 2003, at 09:50 AM, Rodney Wise wrote: I was under the impression that "subroutines" are only executed IF they're called. But, it looks like subroutines will execute on there own if they are written in the beginning part of the PERL code and before other code takes ove

File::Find Laments

2003-09-09 Thread Stephen
I'm doing my best but having a lot of trouble understanding the documentation for File::Find. After seeing a number of people being yelled at for trying to reinvent the wheel by writing their own functions, I'm resigned to throwing up my hands and begging for someone to hold my hand through a

PERL code execution rule?

2003-09-09 Thread Rodney Wise
I was under the impression that "subroutines" are only executed IF they're called. But, it looks like subroutines will execute on there own if they are written in the beginning part of the PERL code and before other code takes over the codes sequence of events. In other words, if there is a sub

RE: labeled blocks

2003-09-09 Thread Dan Muey
> Thomas Browner wrote: > > > > Could some one show me an example of a labeled block (goto)? > > perlsyn.pod has many examples of labeled blocks > > perldoc perlsyn This thread got me thinking. Just for the info, with mod_perl it can be bad to call exit() as you may kill apache. So instead o

RE: grep with ftp

2003-09-09 Thread Dan Muey
> > > > Johnson, Shaunn wrote: > > > > > Howdy: > > > > > > > > > > I'm looking for information that will let me > > > > > open an ftp connection and grep / search > > > > > for files and then FTP them back to me. > > > > > > > > What do you mean "grep/search" for files? If you want to search > >

Re: Executing Perl from inside Perl, using Perl2EXE, Win32 and etc...

2003-09-09 Thread sc00170
I have a problem with my per2exe tool. where could i download and upgrade my current version? Quoting David Mamanakis <[EMAIL PROTECTED]>: > > I have an interesting situation where I am using Perl to develop > installation > scripts. So far, so good. > However, I have 4 total scripts, and I

Re: uninitialized string concatenation?

2003-09-09 Thread James Edward Gray II
On Tuesday, September 9, 2003, at 08:03 AM, LoneWolf wrote: Ok, this has me bewildered. I have added some fields to a pipe-delimited file and added the keys to the switch to chomp each line correctly. I am using the same lines of code that I had before, but now when I run the script I get 'Us

RE: Executing Perl from inside Perl, using Perl2EXE, Win32 and etc...

2003-09-09 Thread Paul Kraus
You can use all exe if you want. How are you calling the scripts. Can you supply some code. Its hard to guess. -Original Message- From: David Mamanakis [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 10:03 AM To: [EMAIL PROTECTED] Subject: Executing Perl from inside Perl, us

Re: trouble with Mail::DeliveryStatus::BounceParser

2003-09-09 Thread David T-G
Joseph, et al -- ...and then R. Joseph Newton said... % % David T-G wrote: % % > I'm having some trouble using this wonderful-looking module to tackle % > catching bounced mail and doing something with it. I've followed the % > man page to a tee but get errors. ... % > print "WE HAVE orig_mes

Executing Perl from inside Perl, using Perl2EXE, Win32 and etc...

2003-09-09 Thread David Mamanakis
I have an interesting situation where I am using Perl to develop installation scripts. So far, so good. However, I have 4 total scripts, and I am calling 3 of them from the main one... Most of the time, the scripts are executed from a machine that DOES NOT have Perl installed, so I have created E

File::Basename

2003-09-09 Thread Paul Kraus
>From how I understood it file::basename was able to tell figure out the filename without path for both windows and UNIX. I have an html page that has a form field for uploading a file. When I hit the choose button it lets me pick something from my directory. Now the filename it returns is the full

script to enumerate window services

2003-09-09 Thread Leon
Hi everyone, Does anyone know how I could go about writing a script to find all the services running on a remote windows 2000 server (actually I need to go through about 200 servers looking for a particular service but if you guys can just help get me started I can write the logic to loop through

RE: authenticate module

2003-09-09 Thread Raghupathy
Thanks Rob... Joseph, I am trying to scrape a website for which I have paid to look at the data. However since it is currently time consuming, I like to parse the data using perl to present it in a condensed form for my personal use. None of the data will be published and so I assume I do not

  1   2   >