[17286] in Perl-Users-Digest
Perl-Users Digest, Issue: 4708 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 24 06:07:27 2000
Date: Tue, 24 Oct 2000 03:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972381912-v9-i4708@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 24 Oct 2000 Volume: 9 Number: 4708
Today's topics:
Re: ActivePerl: Want to skip open files when unlinking <gus@black.hole-in-the.net>
CGI to run makefile <r.fraser@student.murdoch.edu.au>
Re: errors xerxes_2k@my-deja.com
Re: File test -d does not work under Win98 ? <a.vanwingerden@pcmuitgevers.nl>
Re: File test -d does not work under Win98 ? <gellyfish@gellyfish.com>
Re: Formatting of the "make test" output <gellyfish@gellyfish.com>
Re: how to convert 2 arrays to 1 hash <thomas2@dalnet.se>
Re: Legal email addresses... <iltzu@sci.invalid>
Re: Legal email addresses... <themoriman@ntlworld.com>
Re: LWP and Netscape <gellyfish@gellyfish.com>
my script produced no output <james@comistic.om>
Re: my script produced no output <jras@best.ms.philips.com>
Re: New to Perl, Need Help ! (Gwyn Judd)
Re: New to Perl, Need Help ! <a.vanwingerden@pcmuitgevers.nl>
Re: New to Perl, Need Help ! xerxes_2k@my-deja.com
parse url <petermclarke@hotmail.com>
Re: parse url <gus@black.hole-in-the.net>
Re: parse url <elephant@squirrelgroup.com>
Re: pattern matching funky characters <gellyfish@gellyfish.com>
Perl debugger ? <haf@autra.noXX>
Re: Perl debugger ? (Bernard El-Hagin)
Perl <indrachapaw@yahoo.com>
Re: Perl <tward10@jaguar.com>
Re: PerlMagick... <speed.demon9999@virgin.net>
please help me! Installing DBI and DBD on WIN98 <leej100@chollian.net>
Re: Regular expression help - redefinition of the probl (Gwyn Judd)
Re: Regular expression help <lr@hpl.hp.com>
Re: Regular expression help <lr@hpl.hp.com>
Re: Submit buttons <elephant@squirrelgroup.com>
Re: Time-out error <gellyfish@gellyfish.com>
Re: What will the code look like? (Gwyn Judd)
Re: What will the code look like? <themoriman@ntlworld.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 24 Oct 2000 08:57:15 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: ActivePerl: Want to skip open files when unlinking
Message-Id: <972377835.7953.0.nnrp-13.c29f015a@news.demon.co.uk>
jgrinwal@my-deja.com wrote:
> The problem is, the application still has log file open--it just hasn't
> updated it because the application has been idle. The "unlink"
> returns "Permission denied", the same error I would get if the file /
> directory permissions did not allow deleting.
Would it be better to say
foreach file
if [ exists ]
stat perms
if [ perms permit delete ]
unlink || file must be open
Explicity check if you can delete the file, and if you can't the only other
possibility is that NT is preventing you becase the file is open.
Regards,
_Gus
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: Tue, 24 Oct 2000 15:36:11 +0800
From: Fraser <r.fraser@student.murdoch.edu.au>
Subject: CGI to run makefile
Message-Id: <39F53BEB.9D04741A@student.murdoch.edu.au>
I've made a HTML page which I write c code in and I want to submit it to
a Perl CGI script to run a "makefile" on a UNIX system and send me back
the executable.
Can someone please advise on how this is possible.
Regards
Fraser
(I've set permissions and restriction so only I can access the pages.)
------------------------------
Date: Tue, 24 Oct 2000 08:20:35 GMT
From: xerxes_2k@my-deja.com
Subject: Re: errors
Message-Id: <8t3gog$kva$1@nnrp1.deja.com>
i have examined over and over agian. for what you've said. but cant find
anywhere wher i have defined a function within another function.
Are there any more subtle ways of doing this other than directly
defining one sub within another.
i have ruled off each sub with #############################
lines making it really easy to see where one starts and ends. so its
very unlikely i have a sub within a sub.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 10:18:35 +0200
From: "Arie van Wingerden" <a.vanwingerden@pcmuitgevers.nl>
Subject: Re: File test -d does not work under Win98 ?
Message-Id: <8t3gks$46n$1@porthos.nl.uu.net>
Hi to all,
of course you are right!
I was being misled by an example where the "dot" directory was chosen as an
example directory! And specifically in that case it DOES work without
prepending the directory name.
Thanx to you all and I will read the docs more carefully!
Arie van Wingerden
------------------------------
Date: 24 Oct 2000 07:19:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: File test -d does not work under Win98 ?
Message-Id: <8t39lc$8mn$1@orpheus.gellyfish.com>
On Mon, 23 Oct 2000 21:37:28 +0200 arie van wingerden wrote:
> Hi,
>
> I'm using'the O'Reilly Perl Resource Kit for Windows, installed under Win98
> (first edtion).
> If I am using the following code:
> opendir(DIR, $dir) or die $!;
> @dirs = grep(-d, readdir(DIR));
> closedir(DIR) or die $!;
> where $dir is a correct full directory path, which contains several subdirs.
> If I print @dirs only the . and .. directories show up - the others are
> ignored.
> Does someone recognize this?
>
Yes, readdir() only returns the names of the files in the directory you
have opened and not the full path - you will want to do something like:
@dirs = grep -d "$dir/$_", readdir DIR;
If you are going to d something with @dirs later that might require to use
the full path then you might want to use map to prepend the $dir name:
@dirs = grep -d, map { "$dir/$_" } readdir DIR;
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 24 Oct 2000 08:20:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Formatting of the "make test" output
Message-Id: <8t3d83$90a$1@orpheus.gellyfish.com>
On Mon, 23 Oct 2000 10:27:19 +0200 Volker Moell wrote:
> Hi, all!
>
> I have a little question concerning the output of "make test". Under
> "normal" circumstances you get someting like this:
>
>
> t/AssociatorNames...ok
>
> t/Associators.......ok
>
> t/ExtrinsicMethods..ok
>
> t/GetClass..........ok
>
> But when the name of the test scripts become longer the output is no
> longer nice formated:
>
>
> t/GetClass..........ok
>
> t/GetInstance-PaulA_User.ok
>
> t/GetInstance.......ok
>
> t/GetProperty-PaulA_User.ok
>
> Is there a way to make the output look better? Ok, it's by far not a
> important question, but... :-)
>
This is the behaviour of the Module Test::Harness that is used to run
the tests for 'make test' - there is a hard coded width of 20 for the
test name. I am sure if you were to submit a patch it would be
considered.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Tue, 24 Oct 2000 08:55:07 GMT
From: "Thomas Åhlen" <thomas2@dalnet.se>
Subject: Re: how to convert 2 arrays to 1 hash
Message-Id: <L7cJ5.388$Rj1.17472@news.bahnhof.se>
Thanks for all the answers guys!!
This was exactly what i wanted :)
Thomas
------------------------------
Date: 24 Oct 2000 09:05:56 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Legal email addresses...
Message-Id: <972377964.3571@itz.pp.sci.fi>
In article <Dj%I5.8710$bL1.176880@news6-win.server.ntlworld.com>, The Moriman wrote:
>
>I'm trying to write a part for my script, that when checking the email
>address, ensures that it _is_ an address and not a command.
The problem is that it could be both.
E-mail addresses are allowed to contain shell metacharacters. The
real solution to your problem is not restricting the set of allowed
addressed, but using the addresses in such a way that they can not be
interpreted as anything else.
Once you realize that, the problem becomes fairly easy to solve. But
why bother when others have already solved it for you? I'd recommend
looking at http://search.cpan.org/search?dist=MailTools
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla | "By promoting postconditions to
and its pseudonyms - | preconditions, algorithms become
do not feed the troll. | remarkably simple." -- Abigail
------------------------------
Date: Tue, 24 Oct 2000 10:30:47 +0100
From: "The Moriman" <themoriman@ntlworld.com>
Subject: Re: Legal email addresses...
Message-Id: <lFcJ5.10144$bL1.207044@news6-win.server.ntlworld.com>
Ilmari Karonen <iltzu@sci.invalid> wrote in message
news:972377964.3571@itz.pp.sci.fi...
But
> why bother when others have already solved it for you? I'd recommend
> looking at http://search.cpan.org/search?dist=MailTools
>
He looked, he saw, he was stumped :-(
Downloaded the MailTools.
Typed perl Makefile.PL #ok so far
typed make #whoops (bad command or filename)
my perl directory doesn't have a make.exe / make.com / make.bat
file,nor does the directory where I am installing MailTools
It's probably something simple, but what am I missing?
Many thank
TMMan
------------------------------
Date: Tue, 24 Oct 2000 09:09:52 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: LWP and Netscape
Message-Id: <AlcJ5.3272$7u4.65699@news.dircon.co.uk>
On Tue, 24 Oct 2000 02:25:19 GMT, jedelcon@sonic.net Wrote:
> On Mon, 23 Oct 2000 08:41:08 -0700, Jeff Zucker <jeff@vpservices.com>
> wrote:
>
>>Jonathan Stowe wrote:
>>>
>>> On Mon, 23 Oct 2000 14:00:18 GMT, jedelcon@sonic.net Wrote:
>>> > I have an intranet set up at home on which to practice my skills. I am
>>> > running Redhat6.1 on both client and server. The client is in
>>> > x-windows configuration. I
>>> > I successfully installed the LWP module and its dependencies and can
>>> > access an web page from my server using 'getprint'. Unfortunaltely all
>>> > I get is the html code. I want to see the page in Netscape. Is there a
>>> > way to do this.
>>>
>>> Use getstore() and then open the resulting file in your browser.
>>
>>Or continue to use getprint() but put it in a CGI and print a
>>content-header first. That is assuming you have a web server running.
>>
>>> You qwill have to explain what you mean better if that is not what you
>>> expected to have to do.
>>
>>Also true for my part of the possible answer.
>>
>>--
>>Jeff
>
> What I am attemping to do is write a perl script which would run on
> the client machine and randomly display web pages in netscape. These
> pages would be stored and served from my server. This needs to be done
> in a looping fashion with different pages being displayed one after
> the other. In other words it needs to happen with no intervention from
> me. Eventually a cgi script on the server would download pages built
> on the fly. My goal is to be able to loadtest my server by having
> several client machines making page requests at the same time. Is this
> any clearer?
If you are load testing why do you need to display the pages ? If you want
the pages to be really displayed in Netscape then you will need to control
the browser which can be done using its X Properties however this is out
of the scope of this group.
/J\
------------------------------
Date: Tue, 24 Oct 2000 08:06:39 GMT
From: "james@comistic.com" <james@comistic.om>
Subject: my script produced no output
Message-Id: <jqbJ5.510496$8u4.6463446@news1.rdc1.bc.home.com>
i am getting this error script produced no output when trying to run a .pl
file i know that the script is right and that perl is right (well at least
for a smaller pl script) so i figure my server needs something to get it
going. can anyone suggest anything? the script is ez-auction and i have had
it running on another server but now it is on my server and it wont run,
willing to pay for someone THAT KNOWS WHAT THEY ARE DOING when it comes to
installing perl on an NT server to help.
thanks
James
------------------------------
Date: Tue, 24 Oct 2000 10:34:27 +0200
From: "Ras, J. v." <jras@best.ms.philips.com>
Subject: Re: my script produced no output
Message-Id: <39F54993.126B223F@best.ms.philips.com>
Hi James,
I don't know what your error is. When the browser display your perl code
then your server don't support CGI.
When you get a error number then there is a problem in your code.
Please give more details.
Only the follow to do is
- FTP in ASCII mode
- chmod 755 your cgi-bin and perlfile
- give the just path to perl for NT (First line of the Script)
You can ask it to your server info.
Good luck Jos van Ras
http://www.jgmvanras.f2s.com/
"james@comistic.com" wrote:
>
> i am getting this error script produced no output when trying to run a .pl
> file i know that the script is right and that perl is right (well at least
> for a smaller pl script) so i figure my server needs something to get it
> going. can anyone suggest anything? the script is ez-auction and i have had
> it running on another server but now it is on my server and it wont run,
> willing to pay for someone THAT KNOWS WHAT THEY ARE DOING when it comes to
> installing perl on an NT server to help.
> thanks
> James
------------------------------
Date: Tue, 24 Oct 2000 08:12:18 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: New to Perl, Need Help !
Message-Id: <slrn8vah2p.bfl.tjla@thislove.dyndns.org>
I was shocked! How could msalerno@my-deja.com <msalerno@my-deja.com>
say such a terrible thing:
>I am trying to write a basic script that will add some IP addresses to a
>text file. It is not complete but so far I have had a few problems. I
>am trying to use labeled blocks to redo a segment in the event that the
Well you don't have to use labelled blocks. I tend to stay away from
them, myself:
#!/usr/bin/perl -w
use strict;
# try three times. replace this with a 'while (1)' if you want it to
# keep trying forever
for (1..3)
{
print "Enter the IPOA IP Address: ";
chomp(my $ipoaip = <STDIN>);
if (4 != grep { $_ <= 255 && $_ >= 0}
($ipoaip =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/))
{
print "You must enter a valid IP address\n";
next;
}
print "Enter the Ethernet IP Address: ";
chomp(my $ethip = <STDIN>);
if (4 != grep { $_ <= 255 && $_ >= 0}
($ipoaip =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/))
{
print "You must enter a valid IP address\n";
next;
}
if ($ethip eq $ipoaip)
{
print "The IPOA and Ethernet Address must be different\n";
next;
}
last;
}
>addresses match. I would also like to make sure that the IP addresses
>entered are actually IP addresses, I don't need to validate the IP
>addresses but I would like to make sure that the syntax is correct.
The checking above should do what you want. It checks that there are
four fields, all numbers between 0 and 255 inclusive. There is no
guarantee that the IP actually resolves but that's not what you wanted I
guess :)
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Silverman's Law:
If Murphy's Law can go wrong, it will.
------------------------------
Date: Tue, 24 Oct 2000 10:43:56 +0200
From: "Arie van Wingerden" <a.vanwingerden@pcmuitgevers.nl>
Subject: Re: New to Perl, Need Help !
Message-Id: <8t3i4e$66c$1@porthos.nl.uu.net>
<msalerno@my-deja.com> schreef in bericht
news:8t362q$cds$1@nnrp1.deja.com...
> I am trying to write a basic script that will add some IP addresses to a
> text file. It is not complete but so far I have had a few problems. I
> am trying to use labeled blocks to redo a segment in the event that the
> addresses match. I would also like to make sure that the IP addresses
> entered are actually IP addresses, I don't need to validate the IP
> addresses but I would like to make sure that the syntax is correct.
>
> Here is the script, any help would be appreciated.
> Thanks,
> Matt
>
>
> #/usr/bin/perl -w
> ADDRESS:
> print "Enter the IPOA IP Address: ";
> $ipoaip = <STDIN>;
> chomp ($ipoaip);
> print "Enter the Ethernet IP Address: ";
> $ethip = <STDIN>;
> chomp ($ethip);
> if ($ipoaip eq $ethip){
> print "The IPOA and Ethernet Address must be different\n";
> } else {
> print "You entered IPOA $ipoaip\n";
> print "You entered Ethernet $ethip\n";
> redo ADDRESS;
> }
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Hi,
in order to check the ip adressess, you could:
1. use function split with the dot (.) as the separator character on
both ip-adresses, like:
@ipo = split('.',$ipoaip);
2. then you will know the number of digit groups in the ip-address (
scalar(@ipo) resp. scalar(@eth) )
3. instead of comparing the input directly, you should check whether
each digit group in both ip-adresses consist of digits 0..9 (use a regex),
like:
foreach $dgroup (@ipo) {
unless ($dgroup =~ /^[0-9]{1,3}$/) {
die "Invalid digit group";
}
}
4. then compare the digit groups of both ip-adressess one by one
numerically (using == not eq)
Regards,
Arie van Wingerden
P.S. I am also a newbie with Perl ;-)
------------------------------
Date: Tue, 24 Oct 2000 08:29:46 GMT
From: xerxes_2k@my-deja.com
Subject: Re: New to Perl, Need Help !
Message-Id: <8t3h9m$lam$1@nnrp1.deja.com>
>
> #/usr/bin/perl -w
> ADDRESS:
> print "Enter the IPOA IP Address: ";
> $ipoaip = <STDIN>;
> chomp ($ipoaip);
> print "Enter the Ethernet IP Address: ";
> $ethip = <STDIN>;
> chomp ($ethip);
> if ($ipoaip eq $ethip){
> print "The IPOA and Ethernet Address must be different\n";
> } else {
> print "You entered IPOA $ipoaip\n";
> print "You entered Ethernet $ethip\n";
> redo ADDRESS;
> }
that looks nasty , is that sposed to be a loop.
do a proper loop.
sumthin like
$incorrect=1;
while($incorret){
-- whatever code---
if ($ipoaip && $ethip){
$incorrect=1;
}
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 09:39:58 +0100
From: "Peter Clarke" <petermclarke@hotmail.com>
Subject: parse url
Message-Id: <eUbJ5.73898$6N2.485951@monolith.news.easynet.net>
Is there a more efficient way of doing this? I wont to separate the host,
path and query from a given url. It works but seems long winded.
(I'm learning perl so using a module to do this wont show me how its
actually done.)
sub parse_url {
if ($url =~ /(.*?)(\/)(.*)/) { #read upto the first slash "/".
$urlArray{"host"} = $1;
$withouthost = $3;
if ($withouthost =~ /(.*?)(\?)(.*)/) {
$urlArray{"path"} = $1;
$urlArray{"query"} = $3;
} else { # no query
$urlArray{"path"} = $withouthost;
}
} else {
$urlArray{"host"} = $url; #there are no slashes so this must be the host
and nothing else.
}
return %urlArray;
}
Regular expressions will be the death of me...
Peter
------------------------------
Date: Tue, 24 Oct 2000 09:14:15 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: parse url
Message-Id: <972378855.18281.0.nnrp-10.c29f015a@news.demon.co.uk>
Peter Clarke <petermclarke@hotmail.com> wrote:
> Is there a more efficient way of doing this? I wont to separate the host,
> path and query from a given url. It works but seems long winded.
TMTOWTDI, this works fairly well.
($scheme,undef,$host,@rest) = split('/',$url);
($path,$query) = split('\?',join('/',@rest));
print
"Host: $host\n",
"Path: $path\n",
"QS: $query\n";
> (I'm learning perl so using a module to do this wont show me how its
> actually done.)
URI::URL is what you really what though.
Regards,
_Gus
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: Tue, 24 Oct 2000 20:45:34 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: parse url
Message-Id: <MPG.14601354c194df3989844@localhost>
Peter Clarke wrote ..
>Is there a more efficient way of doing this? I wont to separate the host,
>path and query from a given url. It works but seems long winded.
'working' is such a relative term .. your code demonstrates that you do
not know how URLs are correctly formed .. 'http://www.foo.com/' is a
correctly formed URL .. whereas 'www.foo.com/index.html' is not .. so
perhaps your function should be called 'parse_partial_url' or
'split_host_path'
>(I'm learning perl so using a module to do this wont show me how its
>actually done.)
doesn't mean that you shouldn't use one .. do you still use long
division to divide large numbers ?
but anyway - you want to learn - so hang on...
>sub parse_url {
> if ($url =~ /(.*?)(\/)(.*)/) { #read upto the first slash "/".
that $url that you're using is a package variable without an explicit
package reference .. that's bad
in this circumstance you should be passing the string that you want to
operate on in to your subroutine
> $urlArray{"host"} = $1;
here you're using a package variable %urlArray .. you're also using the
word 'Array' to describe what's actually a hash
> $withouthost = $3;
package variable again
> if ($withouthost =~ /(.*?)(\?)(.*)/) {
> $urlArray{"path"} = $1;
> $urlArray{"query"} = $3;
> } else { # no query
> $urlArray{"path"} = $withouthost;
> }
> } else {
> $urlArray{"host"} = $url; #there are no slashes so this must be the host
>and nothing else.
or perhaps your input is 'mailto:foo@bar.com' which also has no slashes
- but neither does it represent a host
the point here is that if there's a module that does what you want -
then use it .. because in most cases the code in modules is reasonably
well tested (especially in modules that are shipped as part of the
distribution) and there will be far fewer bugs than home-grown code
> }
>return %urlArray;
>}
>
>Regular expressions will be the death of me...
so will not reading the docs .. read perlsub to find out more about
subroutines .. and perlre to find out more about regular expressions
then look up URI::URL .. your code could be as simple as this
#!/usr/bin/perl -w
use strict;
use URI::URL;
my $url = new URI::URL( 'http://www.foo.com/bar.pl?foobar=3');
print join "\n" => $url->host, $url->scheme, $url->path, $url->query;
__END__
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 24 Oct 2000 07:39:04 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: pattern matching funky characters
Message-Id: <8t3aq8$8p6$1@orpheus.gellyfish.com>
On Sun, 22 Oct 2000 19:59:17 GMT haigcd@my-deja.com wrote:
<snip>
> There are certain funky escape sequences in the HTML that I
> absolutely need to match, but I can't. For example, the original word
> perfect document contains the astericks character in a bunch of places.
> In the HTML, it comes out as "\253". Here's an example of the
> beautiful Word HTML:
>
> <span style='font-size:6.0pt;font-family:Wingdings;mso-ascii-font-
> family:"CG Times"; mso-hansi-font-family:"CG Times";mso-char-
> type:symbol;mso-symbol-font-family: Wingdings'><span style='mso-char-
> type:symbol;mso-symbol-font-family:Wingdings'>\253<span style='mso-char-
> type:symbol;mso-symbol-font-family:Wingdings'>\253</span>
>
> So, I know that that "\253" character is supposed to be an astericks,
> but neither "\*"
No that will match zero or more backslashes.
> nor "\253" matches it.
That wants to match a literal '\253'.
> I had a similar problem
> with "\240", which appears in the original file as some sort of space,
> but I had no luck matching it with "\240" or "\s", just "\W".
>
> One other thing - the \253 charachter appears in the program more as
> the character "<<" (ascii 171 i think), and in less it appears as a
> highlighted "<AB>". So I guess it's some sort of encoding issue that
> I'm not familiar with.
>
This is all Microsoft Bollocks(tm). You might want to run the HTML files
through the well named 'demoroniser' to fix up all of this cruft. I am
sure a quick search on google for 'demoroniser perl' will throw it up.
> There has to be some way to match this stuff, right?
> Any help would be greatly appreciated.
>
To match these characters you will want to use the \xNN escape in your
regular expression (where NN is a hexadecimal number) - for instance
to match all non-ascii characters you could use :
/[\x80-\xFF]/
You will probably want to read the perlre manpage for more on this.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Tue, 24 Oct 2000 10:35:26 +0200
From: "P.Eftevik" <haf@autra.noXX>
Subject: Perl debugger ?
Message-Id: <39F549CE.89849EBD@autra.noXX>
Is there a debug kind of tool for perl ?
I'd just like to step through parts of scripts, monitor variables
etc.
Thanx for any hint
PEftie
------------------------------
Date: 24 Oct 2000 08:43:22 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl debugger ?
Message-Id: <slrn8vaj04.28m.bernard.el-hagin@gdndev25.lido-tech>
On Tue, 24 Oct 2000 10:35:26 +0200, P.Eftevik <haf@autra.noXX> wrote:
>Is there a debug kind of tool for perl ?
>I'd just like to step through parts of scripts, monitor variables
>etc.
>Thanx for any hint
perldoc perldebug
Like duh.
Cheers,
Bernard
--
perl -le'
($B,$e,$r,$n,$a,$r,$d)=q=$B$e$r$n$a$r$d==~m;
\$(.);xg;print$B.$e.$r.$n.$a.$r.$d;'
------------------------------
Date: Tue, 24 Oct 2000 07:30:05 -0000
From: Luckie <indrachapaw@yahoo.com>
Subject: Perl
Message-Id: <svaejtk3k573de@corp.supernews.com>
I'm trying to run Perl 5.22 using Microsoft Personal Web server Shipped
with Windows 98 CD rom. My ASP codes works just fine but CGI and Perl it
gives an error message as "HTTP error 405, 405 method not allowed" and
some mime type is installed or not ? i tried changing th eregistry
settings script key and entered path for perl.exe and perlis.dll. these
settings i got through another machine where the old personel web server
runs and does not support ASP. please help me in shooting this trouble.
and thanks for reading it too.
regards luckie
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Tue, 24 Oct 2000 09:30:51 +0100
From: "Trevor Ward" <tward10@jaguar.com>
Subject: Re: Perl
Message-Id: <8t3hbs$5q512@eccws12.dearborn.ford.com>
Sorry but you cannot do this.
PWS or personal web server will only suppport ASP Microsofts little we
provide it so we decide what can run.
You can use the next one up on NT and I think win 2000 which enables you to
configure for Perl.
There are quite a few web servers out there including Apache but the Windows
version is not that great yet. To resolve this I used omnihttp server which
allows total configuration.
hope this helps
Luckie <indrachapaw@yahoo.com> wrote in message
news:svaejtk3k573de@corp.supernews.com...
> I'm trying to run Perl 5.22 using Microsoft Personal Web server Shipped
> with Windows 98 CD rom. My ASP codes works just fine but CGI and Perl it
> gives an error message as "HTTP error 405, 405 method not allowed" and
> some mime type is installed or not ? i tried changing th eregistry
> settings script key and entered path for perl.exe and perlis.dll. these
> settings i got through another machine where the old personel web server
> runs and does not support ASP. please help me in shooting this trouble.
> and thanks for reading it too.
>
> regards luckie
>
> --
> Posted via CNET Help.com
> http://www.help.com/
------------------------------
Date: Tue, 24 Oct 2000 10:50:58 +0100
From: "Speed Demon" <speed.demon9999@virgin.net>
Subject: Re: PerlMagick...
Message-Id: <8t3luh$pcr$1@uk21.supernews.com>
Thanks all, got the thing working, worked a charm!!
Cheers again,
Best regards T.Mistry
--------------------------------------------------------
http://www.e-tones.co.uk
Free Resources For Your Mobile Phone
"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrn8va77o.a0g.mgjv@verbruggen.comdyn.com.au...
> On Mon, 23 Oct 2000 20:08:35 +0100,
> Speed Demon <speed.demon9999@virgin.net> wrote:
> > Hi, I have ImageMagick and Perl Magick both installed and working on my
> > server.
> > Only problem is, I have no idea how to use them :)
> >
> > The documentation is basically crap, cant find any good stuff, anywhere.
>
> They do their best. Up until now creating code and improving the
> package has just been a higher priority than writing more
> documentation.
>
> > Basically I have a bunch of images that all need to be 72x14 pixels.
Some
> > are a few pixels out.
> > I need to readin all the images and the crop them accordingly, if you
can
> > send me some sample code I'd appreciate it greatly.
>
> Make sure you copy your images before running this. It will overwrite
> all of them.
>
> #!/usr/local/bin/perl
>
> use strict;
> use Image::Magick;
>
> die "Need some file names" unless @ARGV;
>
> foreach (@ARGV)
> {
> my $im = Image::Magick->new();
> my $rc = $im->Read($_);
> warn "$_: $rc", next if $rc;
>
> $rc = $im->Crop(geometry => '32x14');
> warn "$_: $rc", next if $rc;
>
> $rc = $im->Write($_);
> warn "$_: $rc" if $rc;
> }
>
> This little script is more or less equivalent to
>
> # mogrify -crop "32x14" FILENAMES
>
> You could read the manual pages of the mogrify and convert tools. They
> give a reasonably good explanation of the options, and most command
> line options to those tools have been translated to Perl functions in
> some way or another.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | +++ Out of Cheese Error +++ Reinstall
> Commercial Dynamics Pty. Ltd. | Universe and Reboot +++
> NSW, Australia |
------------------------------
Date: Tue, 24 Oct 2000 18:11:13 +0900
From: "jinlee" <leej100@chollian.net>
Subject: please help me! Installing DBI and DBD on WIN98
Message-Id: <8t3j4o$aua$1@michelle.lgcit.com>
I refered to README in DBI-1.14 but couldn't install that package.
I tried on command line by "ppm install DBI.ppd" but i've got this message
"Error installing package 'DBI.ppd': Could not locate a PPM binary of
'DBI.ppd' for this platform"
I don't understand this message.
now, I'm trying to connect ORACLE with perl.
please help me.
thanks in advance.
------------------------------
Date: Tue, 24 Oct 2000 08:22:17 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Regular expression help - redefinition of the problem
Message-Id: <slrn8vahlh.bfl.tjla@thislove.dyndns.org>
I was shocked! How could jsfinn@my-deja.com <jsfinn@my-deja.com>
say such a terrible thing:
>the problem is that the parser defines passable fields thru only 1
>regular expression...
>
>ie: username=^\w+$
>
>So, I need a single regular expression that will match my criteria
>a) 6-10 chars long
>b) at least 1 letter
>c) at least 1 digit.
How about turning the problem around? Instead of looking for all those
things to be true, why not negate them:
if (m/^.{0,3}$|^.{11,}$|^[^a-zA-Z]+$|^\D+$/)
{
# not a good password
}
Hope that helps.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"I'd love to go out with you, but I have to floss my cat."
------------------------------
Date: Tue, 24 Oct 2000 00:15:15 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Regular expression help
Message-Id: <MPG.145e64612edc86298ae5b@nntp.hpl.hp.com>
In article <39F4BB8F.2510ADEC@vpservices.com> on Mon, 23 Oct 2000
15:28:31 -0700, Jeff Zucker <jeff@vpservices.com> says...
> jsfinn@my-deja.com wrote:
> >
> > Can someone please help me write a regular expression?
> >
> > I am trying to do password validation matching - here are the
> > contraints:
> >
> > At least 6 alpha-numeric characters
> > there must be at least 1 digit
> > there must be at least 1 letter
>
> /\d/ && /\D/ && /^[a-zA-Z0-9]{6,}$/
He said at least 6 alphanumeric characters (which includes '_', but your
character class doesn't), but didn't exclude other characters (as your
regex does).
I'll stand by my already-posted response:
tr/A-Za-z_0-9// >= 6 && tr/0-9// && tr/A-Za-z//
If the 'no-other-characters' constraint applies, then some variation of:
!tr/A-Za-z_0-9//c && length >= 6 && length > tr/0-9//
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 24 Oct 2000 00:52:44 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Regular expression help
Message-Id: <MPG.145edfa652eddcab98ae5c@nntp.hpl.hp.com>
In article <sva9gfcknu3n3d@corp.supernews.com>, cberry@cinenet.net
says...
> Larry Rosler (lr@hpl.hp.com) wrote:
> : Locale-dumb version (ASCII letters only):
> :
> : tr/A-Za-z_0-9// >= 6 && tr/0-9// && tr/A-Za-z//
>
> That will pass anything with at least six alphanumerics and one each of
> alpha and numeric; the excess characters beyond six could be anything.
> For example 'abc&&&&123' would evaluate as true against the test above.
According to my intent.
> : Locale-wise version:
> :
> : /(?:\w.*){6}/s && /\d/ && /[^\W_\d]/
>
> Same problem.
Not a problem -- my choice of a permissive interpretation of the
specification.
A follow-up from the original poster (to you, in fact) shows /^\w+$/, so
the solution must be more restrictive.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 24 Oct 2000 19:53:04 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Submit buttons
Message-Id: <MPG.1460070827784a4e989843@localhost>
marvin wrote ..
>In article <%c5J5.278$h32.225140@typhoon.southeast.rr.com>,
>jlinch@mediaone.net says...
>> Is it possible to have multiple Submit buttons on a form? What I want to do
>> is set up a form to add, edit, or delete a database record. My thought is to
>> have a Submit button for each of these actions. Obviously, I would want to
>> be able to tell, from the Perl script, which button was pressed so that I
>> could handle it appropriately. Any help on this would be appreciated.
-
>One way to do it is
>
><INPUT TYPE=image SRC=/usr/mypic/pica.gif NAME=add>
><INPUT TYPE=image SRC=/usr/mypic/pice.gif NAME=edit>
><INPUT TYPE=image SRC=/usr/mypic/picd.gif NAME=delete>
>
>Paramaterers are passed to the cgi as
>add.x=15&add.y=17 if add is clicked and so on
>
>so
>
>AddRecord() if param('add.x') ;
>EditRecord() if param('edit.x') ;
>DeleteRecord() if param('delete.x') ;
>
>would probably work
an answer that demonstrates perfectly the reason why you should ask
HTML/CGI questions in HTML/CGI related newsgroups
marvin - there are far simpler approaches than what you've used here
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 24 Oct 2000 08:30:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Time-out error
Message-Id: <8t3dqg$91d$1@orpheus.gellyfish.com>
On Fri, 20 Oct 2000 23:12:19 GMT Clinton A. Pierce wrote:
> [Posted and mailed]
>
> In article <8spfk8$r4$1@nnrp1.deja.com>,
> fayerman@my-deja.com writes:
>> First line of this code causes time-out, what can be wrong?
>>
>
> For starters, the fact that you didn't post nearly enough useful
> information. $t is apparently an object. Created by what module?
> Or something homespun? Without knowing that, how the heck are we
> supposed to figure out what class "cmd" belongs to and what it's supposed
> to be doing.
>
Oh, Clinton I'm surprised at you - everyone knew it was Net::Telnet ;-}
However, yes, without knowing what the OP is connected to and what
they are trying to do diagnosis does become a little difficult.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Tue, 24 Oct 2000 07:14:23 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: What will the code look like?
Message-Id: <slrn8vadm8.bfl.tjla@thislove.dyndns.org>
I was shocked! How could Tad McClellan <tadmc@metronet.com>
say such a terrible thing:
>I don't know who Spike Milligan is, nor what the Goon Show is :-(
I pity you terribly. Goest though to Google and type in 'Spike Milligan'
and you will get a ton of links to one of the funniest men that ever
lived.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
confusion, n:
Father's Day in San Francisco.
------------------------------
Date: Tue, 24 Oct 2000 08:23:59 +0100
From: "The Moriman" <themoriman@ntlworld.com>
Subject: Re: What will the code look like?
Message-Id: <dNaJ5.9111$Rk5.223815@news2-win.server.ntlworld.com>
Tad McClellan <tadmc@metronet.com> wrote in message
news:slrn8v9sgf.5oa.tadmc@magna.metronet.com...
> I don't know who Spike Milligan is, nor what the Goon Show is :-(
>
> But Ogden Nash wrote the quoted poem.
>
Shame for not knowing Spike, but my mistake, it _was_ Ogden Nash who wrote
the quoted poem
_but_ it was Spike Milligan who quoted the wrote poem ;-)
Search "Spike Milligan Goon" and enjoy
All the best
TMMan
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4708
**************************************