[16362] in Perl-Users-Digest
Perl-Users Digest, Issue: 3774 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 22 03:05:27 2000
Date: Sat, 22 Jul 2000 00:05:13 -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: <964249513-v9-i3774@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 22 Jul 2000 Volume: 9 Number: 3774
Today's topics:
Re: a regular expression with all except ... <jdavis@genesiswd.com>
Active Perl/NT and IIS (Shinpei Kuga)
Re: ATTENTION PERL MEATHEADS (Gwyn Judd)
Re: File Token <billy@arnis-bsl.com>
Free Programmer joejava@dragoncat.net
Re: Free Programmer <iownu@hotmail.com>
Re: how to check for integer? <waltman@netaxs.com>
How to obtain square root in perl? (jazztone)
Re: How to obtain square root in perl? (jazztone)
Re: How to obtain square root in perl? <debjit@oyeindia.com>
Re: How to obtain square root in perl? (Gwyn Judd)
Re: Keeping quoted text intact within a split (Abigail)
Length of TTF string in pixels? <henry.thorpe@att.net>
Re: Looking for domain hosting service with perl/php/my <look@in.message.com>
Re: Matts Script Archive - A critique (Douglas Wilson)
Re: Matts Script Archive - A critique (Randal L. Schwartz)
Re: MySQL sample code? (brian d foy)
Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible? vartekquest@my-deja.com
perl for embeded scripting <jdavis@genesiswd.com>
Re: perl-5.6.0: Bug with "not" operator? (Keith Calvert Ivey)
Re: Populating Complex Data Structure Problem <montyh@defender.gpcc.itd.umich.edu>
Re: redirection fails (Abigail)
Re: Returning a file <care227@attglobal.net>
Running a stored procedure via perl/ado <notonyourlife@noway.com>
Re: Security of CGI General Question <godzilla@stomp.stomp.tokyo>
Re: Security of CGI General Question <care227@attglobal.net>
Re: Sending mail using sockets (Abigail)
Shopping Agent? paulmaas@my-deja.com
Re: Swapping items in an array of associative arrays <debjit@oyeindia.com>
Re: To CGI.pm or not? <webmaster@lovergirl.com>
Re: To CGI.pm or not? (brian d foy)
Re: uninitialized variable value? (Abigail)
Re: uninitialized variable value? (Keith Calvert Ivey)
Re: Where can I find more information (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Jul 2000 06:32:31 GMT
From: Jeff Davis <jdavis@genesiswd.com>
Subject: Re: a regular expression with all except ...
Message-Id: <500B9F8B.EFC264E3@genesiswd.com>
If I understand what you are saying, than your logic is slightly flawed
with respect to you goal.
What you want, it looks like, is a situation that doesn't match if a few
things are true about the middle of the string. That can be accomplished
with ample use of the 'not' syntax of regexes. this is done like:
firstpartofstring[^a]end
will match any one letter in that space enclosed by brackets except 'a'
[^an] = not a or n
[rz] = r or z
using the not syntax (using '^') you can do everything the opposite.
What it looks like you were trying to do was match anything that did not
fit a particular patter in a certain place, but the way you were doing it
is kind of like saying to a security guard to not let robbers in, and
then he goes on to inspect each atom of a robber and none of them are
robbers by themselves, so he lets them all in as one whole robber.
Hope this helped,
Jeff Davis
truonsr@euromsx.gemse.fr wrote:
> hi everyone,
>
> how can we specify a regular expression : "anything except <a regular
> expression>".
>
> I tried
>
> .*?(?!notWantedString).*?
>
> but it does not work ??!!!
>
> Thanks.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: 22 Jul 2000 05:54:09 GMT
From: snafu@mit.edu (Shinpei Kuga)
Subject: Active Perl/NT and IIS
Message-Id: <39793701$0$9425@senator-bedfellow.mit.edu>
OK I have a problem
I wrote a perl (Active Perl) script that allows web users
to write to (hopefully) world writeable directory
on NT4.o running IIS 4.0
However it si not opening any files on ethw orld writeable dir.
AFAIK the script is working fine- been tested on a Unix xyxtem
and tested on the NT server through the command line only dies
due to failing to open the requisite files (will proceed normally
withouth opening files if the die handlers are pared off)
I think iys the permissions on the world writeable directory but I've
checked the properties and Read/Write permissions have all been set- Moreover the NT permissions are fine (even more permissive witgh Everyone/Full Control)
Is there any issue I have failed to see that someone is aware of?
Could someoene mail me with what configuration they set up their IIS
world dir. that a CGI (perl) script can write to? Any info would be appreciated
------------------------------
Date: Sat, 22 Jul 2000 05:07:48 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: ATTENTION PERL MEATHEADS
Message-Id: <slrn8nib11.9mt.tjla@thislove.dyndns.org>
I was shocked! How could Cal Henderson <cal@iamcal.com>
say such a terrible thing:
>"Gwyn Judd" <tjla@guvfybir.qlaqaf.bet> wrote...
>
>: >--
>: >use LWP::Simple;
>:
>: print "Content-Type: text\plain\n\n";
>:
>: >$g = get
>: >("http://3483852801/%7e%63%61ll%67i%72l/%76i%64%65%67%6f%64z%2e%68%74%6dl");
>: >$g =~ s/(<([^>]+)>)|\n|GODZILLA|Blue Oyster Cult//g; $g =~
>: >s/([a-z])([A-Z])/$1\n$2/g;
>: >$g =~ s/(He )/S\l$1/g; $g =~ s/H(e')/Sh$1/; print ${\substr ($g, 9, 429)};
>exit;
>:
>: Hope that helped.
>
>At a guess, i'd say you don't need a content-type header in every perl script,
>but hey.
True. Actually it was meant to be some sort of droll comment on
Godzilla's habit of doing same whenever she writes a script.
>The point is that you probably don't want to escape the 'p' in plain. Try this:
>
>print "Content-Type: text/plain\n\n";
Whoops my bad :)
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
An air of FRENCH FRIES permeates my nostrils!!
------------------------------
Date: Sat, 22 Jul 2000 01:21:10 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: File Token
Message-Id: <8lastt$akk$1@nnrp1.deja.com>
In article <u9n1jbentv.fsf@wcl-l.bham.ac.uk>,
nobull@mail.com wrote:
> Ilja Tabachnik <billy@arnis-bsl.com> writes:
>
> > IMHO you need file locking (available from C and Perl).
>
> Sounds like he wants locking but AFAIK there's no way to atomically
> create and lock a file.
But locking itself _is_ atomical - and it's enough:
1. Open a file (create if there is no such file at momet).
You will be able to open it anyway - is it already
locked by somebody or not. Even zero-length file is OK.
2. Try to get a lock of needed type by using flock() or fcntl().
You will block here if file is already locked my somebody.
3. When got - do the job.
4. Close or unlock the file (even no need to unlink() it).
So the *presence* of file means *nothing*.
Only locking is essential - and locking *is* atomical.
Also, if the lock holder dies (without explicitly
unlocking the file) there will be no deadlock -
all locks are released when the process terminates.
In many cases there is no need for additional lock file -
just lock the file holding data you are working with.
>
> Lockfiles would do the trick but are messy.
>
Hm-m, not at all. The only thing is that all processes
should agree to common protocol - but that's why it's
called "advisory locking".
> Better idea is probably to create the file under a different name and
> then rename it.
May work. But sure will not work if there are many files in
question - you cannot rename many files atomically.
> This has nothing to do with Perl.
Agreed.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 02:48:24 GMT
From: joejava@dragoncat.net
Subject: Free Programmer
Message-Id: <8lb21k$e0l$1@nnrp1.deja.com>
When do you ever get anything free? Well I have a strong HTML
background but have been learning Perl and I'm looking for real world
projects to get involved in to expand my knowledge so I can get
better.
I'm new to Perl but have a very analytical mind and am quick to learn
and adapt to new ideas.
So if you need something done and willing to work with me on time and
other possible constraints for free let me know.
Thanks
Joel
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 21 Jul 2000 22:18:09 -0700
From: "B. Gates" <iownu@hotmail.com>
Subject: Re: Free Programmer
Message-Id: <e4ae5.30$yu3.878@news.inreach.com>
Cool! Nothing beats that.
<joejava@dragoncat.net> wrote in message news:8lb21k$e0l$1@nnrp1.deja.com...
> When do you ever get anything free? Well I have a strong HTML
> background but have been learning Perl and I'm looking for real world
> projects to get involved in to expand my knowledge so I can get
> better.
>
> I'm new to Perl but have a very analytical mind and am quick to learn
> and adapt to new ideas.
>
> So if you need something done and willing to work with me on time and
> other possible constraints for free let me know.
>
> Thanks
> Joel
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: 21 Jul 2000 21:28:24 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: how to check for integer?
Message-Id: <m3lmyvgdhj.fsf@netaxs.com>
Dave Bradshaw <daveb@telus.net> writes:
> Francis Litterio wrote:
> >
> > User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6
> >
> > elephant@squirrelgroup.com (jason) writes:
> >
> > > Mariska writes ..
> > > >I don't know how to check if a number is an integer.
> >
> > > if you don't know whether it'll be an integer or not then a small change
> > > to
> > >
> > > $var =~ /^\d*[02468]$/;
> > >
> > > will make sure it's an integer
> >
> > That doesn't detect negative integers (e.g. -3).
>
> perhaps don't use regexp?
>
> my $i = shift ;
>
> if ( $i != int($i)) {
> print "$i not an int!\n" ;
> }
This is a FAQ. Look in perlfaq4 under "How do I determine whether a
scalar is a number/whole/integer/float?"
------------------------------
Date: Sat, 22 Jul 2000 04:59:42 GMT
From: jazztone@earthlink.net (jazztone)
Subject: How to obtain square root in perl?
Message-Id: <jazztone-2207000119290001@1cust191.tnt3.princeton.nj.da.uu.net>
Howdy,
I'm doing some statistics programming and need to take a square root.
My book ("Learning...") doesn't have it, as far as I can tell. Any
help much apprecaited, I'm stucked.
Jazz
------------------------------
Date: Sat, 22 Jul 2000 05:11:03 GMT
From: jazztone@earthlink.net (jazztone)
Subject: Re: How to obtain square root in perl?
Message-Id: <jazztone-2207000130500001@1cust191.tnt3.princeton.nj.da.uu.net>
In article
<jazztone-2207000119290001@1cust191.tnt3.princeton.nj.da.uu.net>,
jazztone@earthlink.net (jazztone) wrote:
>Howdy,
>
>I'm doing some statistics programming and need to take a square root.
>My book ("Learning...") doesn't have it, as far as I can tell. Any
>help much apprecaited, I'm stucked.
>
>Jazz
Nevermind:
sqrt ()
Thanks
Jazz
------------------------------
Date: Sat, 22 Jul 2000 11:03:09 +0530
From: "Debjit" <debjit@oyeindia.com>
Subject: Re: How to obtain square root in perl?
Message-Id: <8lcgi4$938$1@news.vsnl.net.in>
C:\httpd\cgi-bin>perldoc -f sqrt
sqrt EXPR
sqrt Return the square root of EXPR. If EXPR is omitted, returns
square root of `$_'. Only works on non-negative operands, unless
you've loaded the standard Math::Complex module.
use Math::Complex;
print sqrt(-2); # prints 1.4142135623731i
jazztone wrote in message ...
>Howdy,
>
>I'm doing some statistics programming and need to take a square root.
>My book ("Learning...") doesn't have it, as far as I can tell. Any
>help much apprecaited, I'm stucked.
>
>Jazz
------------------------------
Date: Sat, 22 Jul 2000 06:09:55 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: How to obtain square root in perl?
Message-Id: <slrn8nielg.9mt.tjla@thislove.dyndns.org>
I was shocked! How could jazztone <jazztone@earthlink.net>
say such a terrible thing:
>Howdy,
>
>I'm doing some statistics programming and need to take a square root.
>My book ("Learning...") doesn't have it, as far as I can tell. Any
>help much apprecaited, I'm stucked.
>
>Jazz
sqrt EXPR
sqrt Return the square root of EXPR. If EXPR is
omitted, returns square root of `$_'. Only works
on non-negative operands, unless you've loaded the
standard Math::Complex module.
use Math::Complex;
print sqrt(-2); # prints 1.4142135623731i
You need to check the documentation that comes with perl next time :)
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
You will live a long, healthy, happy life and make bags of money.
------------------------------
Date: 21 Jul 2000 21:12:34 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Keeping quoted text intact within a split
Message-Id: <slrn8nhu95.s9j.abigail@alexandra.delanet.com>
Pat Traynor (pat@ssih.com) wrote on MMDXVI September MCMXCIII in
<URL:news:39786a4f.21700685@news.giganews.com>:
|| I'm writing an SQL web application. Part of it is a search utility that
|| will ask for keywords from the user. It's easy to take a group of
|| words:
||
|| red blue yellow
||
|| And then split them into an array of three elements that I can use for
|| searches. However, I want people to be able to quote multiple words:
||
|| red blue "light purple"
||
|| And be able to parse that into three elements, "light purple" being a
|| single element.
||
|| I can imagine a sort of kludgey method where I'd first split on the
|| quote marks and then split on the spaces, but I'm hoping there's a more
|| graceful method.
You'd use the same parsing techniques as for a comma separated file.
Except that instead of commas, you use spaces.
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Sat, 22 Jul 2000 04:23:18 GMT
From: "Henry E. Thorpe" <henry.thorpe@att.net>
Subject: Length of TTF string in pixels?
Message-Id: <3979216C.4F4B02A6@att.net>
I have a datafeed that needs to truncate certain lines so that they
don't break across lines in a specific width table in HTML output (web
designers can be particular). In other words, I need to be able to
figure out how many pixels wide a particular text string will be when
rendered in a given truetype font at a given font size.
Other than dumping the font metrics to a table (the designers are using
a single Web-ish true-type font in 11pts), how can I determine the
string width, accounting for paired kerning?
I have looked at various modules from CPAN for getting TTF metrics, but
have yet to find an example of what I suspect is a common problem, e.g.,
determining the rendered width of the string.
Can anyone provide any pointer to where I might look for example code in
Perl, C, or Java?
TIA,
Henry
------------------------------
Date: Fri, 21 Jul 2000 23:09:25 -0600
From: "Streamline" <look@in.message.com>
Subject: Re: Looking for domain hosting service with perl/php/mysql
Message-Id: <39792df9@news.in-tch.com>
Tom Stelzriede <tstel@yahoo.com> wrote in message
news:4h8hns84ars78v7f207dp2ebfmiu9q5ckt@4ax.com...
> Can anyone recomment to me a domain hosting service that offers
> perl/php/mysql and has reasonable pricing and good server response
> time.
>
> Thanks,
>
> Tom
Tom,
It depends on what you consider reasonable price, and what is offered for
that price. If you would like to see what I've got to offer, email me at
streamline@theglobal.net
and I'll give you my URL. The reason for requiring you to email me is that
I don't care for promoting in newsgroups.
------------------------------
Date: Sat, 22 Jul 2000 01:33:39 GMT
From: dwilson@gtemail.net (Douglas Wilson)
Subject: Re: Matts Script Archive - A critique
Message-Id: <39753848.1103983@news>
On Thu, 20 Jul 2000 08:50:12 -0700, "Godzilla!" <callgirl@la.znet.com> wrote:
>Richard Lawrence wrote:
>
>> Godzilla!wrote:
>> > Richard Lawrence wrote:
>> > Why only Matt's scripts?
>
>> His are some of the most widely used (and critisised). Using some
>> obscure script written by someone who no-one has heard of would also
>> work, but probably wouldn't have quite the same impact.
>
>
>So your opinion is people will learn Perl programming
>better by selecting the scripts of only one person for
>critique? This suggests other scripts which exemplify
>well a common problem should be ignored because these
>scripts are not written by the 'right' author.
Godzilla is really the FAE!!! :)
Cheers,
Douglas Wilson
------------------------------
Date: 21 Jul 2000 23:56:43 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Matts Script Archive - A critique
Message-Id: <m1zonay7o4.fsf@halfdome.holdit.com>
>>>>> "Godzilla!" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
Godzilla!> Wall, Schwartz, Brenner and a handful of others,
Godzilla!> are the Founding Fathers of Perl. No period.
Just a datapoint... I had to read up this thread a couple of
steps to even know who "Brenner" was in this sentence.
You'd think the "Founding Fathers" would have lunch with each other
once in a while, eh? Larry Wall and I have had lunch a number of
times, but Brenner has never even sent me email that I can recall, nor
participated on P5P. You want founding fathers, check out THAT list.
Steve, if you're reading this, sorry. But you just don't hang with
the rest of us. We'll have to all hang separately. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sat, 22 Jul 2000 00:32:54 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: MySQL sample code?
Message-Id: <brian-ya02408000R2207000032540001@news.panix.com>
In article <8la8ot$kmc$15$1@news.t-online.com>, "Raphael Pirker" <raphaelp@nr1webresource.com> posted:
> Ok, finally my host allows mySQL connection with Perl using DBI module.
> Could someone please provide some sample code which connects to a Database
> and performs a simple search, selects that row and stores the results. Or
> are there documentation/tutorials available on the net?
you can look at the DBI documentation. the only thing that changes
from server to server is the connect string and the valid query
statements.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Sat, 22 Jul 2000 02:54:23 GMT
From: vartekquest@my-deja.com
Subject: Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible??
Message-Id: <8lb2cq$eb6$1@nnrp1.deja.com>
>
> >I haven't yet talked to anyone thats done it successfully.
>
> now you have.
>
> >i beleive it has something to do with mod_perl completely hating
apache with
> >dso but not sure..
>
> don't use DSO, which is of questionable value anyway. perhaps that is
> your problem.
Brian, could you enlighten us so as which should be the installation
procedure that you followed to have both
MySQL+Apache+PHP+mod_perl+mod_ssl installed on the same machine if not
by DSO?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 05:12:00 GMT
From: Jeff Davis <jdavis@genesiswd.com>
Subject: perl for embeded scripting
Message-Id: <500B8CAE.9EC86427@genesiswd.com>
I am in the early stages of writing a large program in which I would
like to use perl (the core language will be C, most likely). I would
like to make it extensible with a powerful scripting language for which
perl would be ideal.
The problem is that I can't let people use things such as 'open()' and
other "unsafe" operations. In other words, I want a scripting language
that you can't write a virus in. I think I could figure out which
functions I could allow safely, but I need the rest to be completely
forbidden.
I would just be including the scripts that would call object methods
(from my own code, which would be unrestricted) and use the perl control
structures (which I happen to like).
I appreciate any advice, including other strategies for what I wan to
do.
Thanks,
Jeff Davis
------------------------------
Date: Sat, 22 Jul 2000 05:54:23 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: perl-5.6.0: Bug with "not" operator?
Message-Id: <397934f5.522467@news.newsguy.com>
mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>Keith Calvert Ivey <kcivey@cpcug.org> wrote:
>>
>>Can you give an example of an expression you'd use in a real
>>program where the changed behavior makes a difference and where
>>you prefer the old behavior? I find it hard to imagine that
>>someone would use "not($a) and $b" to mean "not($a and $b)".
>
>That's hardly a useful example, since its meaning hasn't changed.
Um, er, well, it must have been either too early or too late for
me to be posting when I wrote that, but the point applies to any
binary operator, including those where the precedence does make
a difference.
>The examples which have come up are like
>
> not (localtime)[6]; # it isn't Sunday
Yes, but have you ever seen that used in a real program?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: Sat, 22 Jul 2000 01:38:49 GMT
From: monty hindman <montyh@defender.gpcc.itd.umich.edu>
Subject: Re: Populating Complex Data Structure Problem
Message-Id: <JW6e5.303$ks4.5808@news.itd.umich.edu>
Have you checked the contents of the structure with Data::Dumper? Maybe
that will tell you whats going wrong.
-- Monty
N.Jennings@soton.ac.uk wrote:
: Hi,
: I am having problem automatically populating a complex data structure of
: roughly the type:
: Records =
: IDNO1 => {
: TypeA => [
: { field1 => val1, field2 => val2, field3 => val3
: },
: { field1 => val1, field2 => val2, field3 => val3 }
: ],
: TypeB => [
: { field1 => val1, field2 => val2, field3 => val3
: },
: { field1 => val1, field2 => val2, field3 => val3 }
: ],
: },
: IDNO2 => {
: TypeA => [
: { field1 => val1, field2 => val2, field3 => val3
: },
: { field1 => val1, field2 => val2, field3 => val3 }
: ],
: TypeB => [
: { field1 => val1, field2 => val2, field3 => val3
: },
: { field1 => val1, field2 => val2, field3 => val3 }
: ],
: }
: )
: I have a loop in which the values of fields are determined as well as a
: hash array for the
: { field1 => val1, field2 => val2, field3 => val3} structure is created.
: I need to put these elements together
: e.g.
: while ($line = <INFILE>)
: {
: chomp($line);
: @tmp = split(/:/,$line,5);
: $idno = $tmp[4];
: $type = $tmp[3];
: undef(%fields);
: %fields = (map(split(/\=/,$_),split(/,/,$tmp[5])));
: push @{ $records{$idno}{$type} }, { %fields };
: }
: However, my push statement isnt working as I hoped. I have looked at the
: Perl Data Structures Cookbook pages but still can't get a working
: solution.
: Any help steering me in the right direction will be much appreciated.
: Cheers
: Neville
: Sent via Deja.com http://www.deja.com/
: Before you buy.
--
------------------------------
Date: 21 Jul 2000 22:01:56 EDT
From: abigail@foad.org (Abigail)
Subject: Re: redirection fails
Message-Id: <slrn8ni15n.sif.abigail@alexandra.foad.org>
haggi@work (haggi@tappe.net) wrote on MMDXVI September MCMXCIII in
<URL:news:39788CDD.2078865C@tappe.net>:
}}
}} Hi,
}}
}} I'm trying to redirect a output in perl.
}}
}} system("ls -l > outputfile");
}}
}} I'm working with perl5.005 for cygwin. Windows NT.
}}
}} redirection in the shell works.
Well, what happens here is that perl starts up a shell, and have the
shell doing the redirection. The ">" character as used above is *NOT*
dealt with by Perl. As soon as Perl found the first space in "ls -l >
outputfile", it knew it had to give the command to the shell, and have
the shell deal with it.
I am not sure why you use the above system() command. Do you really want
to have the output of "ls -l" be in that file? Because if you are doing
this just to later read in the file, you are acting in an extremely
unPerlish way. You could just use 'open my $ls, "ls -l |" or die $!',
or my $list = `ls -l`, or just do a readdir() and stat().
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Fri, 21 Jul 2000 21:15:11 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Returning a file
Message-Id: <3978F59F.4459C81B@attglobal.net>
white_jeremy@my-deja.com wrote:
>
> Good advice, but I don't want to write an html file to return a value.
> I want the script to look and act like an image file when it is called
> so that I could use it as an onMouseOut file for example.
>
> Is that possible?
Im not sure I get what you mean. I'm not a user of Java Script, so
I don't know what an onMouseOut file is or how it behaves.
I don't think, however, that what you want is possible.
------------------------------
Date: Sat, 22 Jul 2000 15:01:44 +0800
From: "Paul" <notonyourlife@noway.com>
Subject: Running a stored procedure via perl/ado
Message-Id: <397946c3@pink.one.net.au>
Hi
I have a pretty easy task. I have a stored procedure in MSSql Server 7 which
takes one input parameter and returns and output parameter. We have an
application developed in perl that needs to run this stored procedure and
return the output parameter.
Using DBD::ODBC I was able to run the stored procedure easily, but I
couldn't get the output parameter returned. So I tried DBD::ADO.
ADO has little docco compared to DBD::ODBC and all I could find was a mini
FAQ at: http://www.fastnetltd.ndirect.co.uk/Perl/perl-win32-database.html
Is there any other docco somewhere or example code of calling a stored proc,
passing input parameters and returning output parameters?
thanks
Paul
pculmsee@XXXXwiredcity.com.au
------------------------------
Date: Fri, 21 Jul 2000 20:07:18 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Security of CGI General Question
Message-Id: <39790FE6.7D2037D5@stomp.stomp.tokyo>
Drew Simonis wrote:
> "Godzilla!" wrote:
> > Drew Simonis wrote:
> > > "Godzilla!" wrote:
> > > That is complete and total crap, and you know it.
> > Having a bad hair day, Ms. Mueller?
> No. I shave my bean, so I have no hair.
Puberty is near in your future. This embarrassment
will resolve itself. A bean seems a most logical
analogy in your case. Such duality in pun.
> Your flippant attitude is what is bad here.
Not really. What is bad is actually what
I am flipping you.
> I can understand if people make an honest mistake,
> I do it myself all the time.
Boy I'll say you do.
> What I can't stand is when someone purposefully
> does something that may cause harm, which is what you
> did. Its wrong, its dangerous, and you know it.
* laughs *
You are a right funny boy.
Try sitting. Adjust your trouser crotch. Take
a load off your mind. You might relax a bit.
Back in 1995, when Michael Fremont of the Internet
Roundtable Society, released his first version of
a rather famous chat script, before year's end my
reputation spread like wildfire across our internet.
People said and still say,
"Don't talk with Kira. She is dangerous."
However, I did make an agreement with Fremont to
never divulge what I know about Perl based chat
scripts and associated problems, like keeping me
under control within chatlines.
Yes, I am intellectually dangerous. This is why
I don't respond much to you. This would be most
unsporting of me, a turkey shoot really.
> > print "file:///%43|%2f";
> Im impressed.
You would be more impressed if I initiated
a format of your C drive quicker than you
could hit your power button.
Godzilla!
--
@© = (a .. z); @® = qw (7 15 4 26 9 12 12 1 18 15 3 11 19);
srand(time() ^ ($$ + ($$ << 15)));
sub G { rand(1000) < 500 ? "\u$1" : "\l$1" ; }
foreach $¿ (@®) { $¢ = $©[$¿-1]; $¢ =~ s/([a-z])/G($1)/gie;
if ($¢ =~ /($©[0])/i) { $¢ = "$¢ "; } print $¢; }
print "!"; exit;
------------------------------
Date: Sat, 22 Jul 2000 00:20:50 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Security of CGI General Question
Message-Id: <39792122.A9AF644E@attglobal.net>
"Godzilla!" wrote:
>
> Not really. What is bad is actually what
> I am flipping you.
One of your code examples?
>
> > I can understand if people make an honest mistake,
> > I do it myself all the time.
>
> Boy I'll say you do.
But you really wouldn't need to, since I just did.
>
> > What I can't stand is when someone purposefully
> > does something that may cause harm, which is what you
> > did. Its wrong, its dangerous, and you know it.
>
> * laughs *
>
> You are a right funny boy.
Who said I'm a boy?
>
> Back in 1995, when Michael Fremont of the Internet
> Roundtable Society, released his first version of
> a rather famous chat script, before year's end my
> reputation spread like wildfire across our internet.
> People said and still say,
>
You have a most inflated opinion of yourself, don't you? I've never
seen anyone pump their own bellows as much as you like to do. Then
you insult ofthers for the exact same behaviour. But fools seldom
see their own foolishness.
> "Don't talk with Kira. She is dangerous."
s/dangerous/annoying/
> However, I did make an agreement with Fremont to
> never divulge what I know about Perl based chat
> scripts and associated problems, like keeping me
> under control within chatlines.
Thats because every Perl based chat script isidentical, huh? And
no one writes them differently in 2000 when compared to 1995?
Arrogant twit.
> Yes, I am intellectually dangerous. This is why
> I don't respond much to you. This would be most
> unsporting of me, a turkey shoot really.
>
> > > print "file:///%43|%2f";
>
> > Im impressed.
>
> You would be more impressed if I initiated
> a format of your C drive quicker than you
> could hit your power button.
I didn't know I _had_ a C drive. I'd be interested in seeing you
format it, in any event.
------------------------------
Date: 21 Jul 2000 22:41:00 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Sending mail using sockets
Message-Id: <slrn8ni3ev.sif.abigail@alexandra.foad.org>
Are Bjoerby (are.bjoerby@pineapple.no) wrote on MMDXVI September MCMXCIII
in <URL:news:v0Xd5.3386$Dxe.188891136@news.telia.no>:
&& Hi!
&&
&& I'm looking for a routine that will send mail using sockets. As I'm new to
&& Perl an easy-to-integrate script is what I'm looking for.
Most electronic mail delivery is done with sockets these days. Dial in
UUCP isn't very common anymore.
So, what exactly do you want? Talking SMTP yourself? Well, then you
just open a socket and talk SMTP. To open a socket, you either use
socket(), bind(), listen() and frieds, or you use the IO::Socket
module. How to talk SMTP isn't a Perl question though.
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Sat, 22 Jul 2000 02:39:26 GMT
From: paulmaas@my-deja.com
Subject: Shopping Agent?
Message-Id: <8lb1gs$dko$1@nnrp1.deja.com>
Hi,
For the last 14 days we have been trying to find a good shopping
agent for our site (something like BottomDollar.com).
We don't want to to built it ourselves at this moment (we lack the
expertise), so we like to buy it.
I have tried to find this software in large computer stores, but only
found general agent software or shopping carts. The only Shoppers I
found on the Web are: http://www.alphashopper.com/test/ and the
Beta software: http://www.sqldata.com/. But I want something to
compare these with.
I appreciate any help,
Paul Maas
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 10:27:46 +0530
From: "Debjit" <debjit@oyeindia.com>
Subject: Re: Swapping items in an array of associative arrays
Message-Id: <8lcefe$876$1@news.vsnl.net.in>
I think this may help you
#!/usr/bin/perl
my @LoH =
{name => Debjit, age => 29},
{name => Hemanth, age => 28},
{name => Pani, age => 25}
);
@newLoH = sort{$a->{age} <=> $b->{age}}@LoH;
foreach $Href(@newLoH) {
print $Href->{name}, "\n";
}
----output----
C:\httpd\cgi-bin>perl -w LoHsort.pl
Pani
Hemanth
Debjit
---------------
Chris Moreton wrote in message <8la7vl$n2r$1@lure.pipex.net>...
>Hi,
>
>I have an array of associative arrays so that, for example, I can store the
>data below.
>
> $item[0]{'key1'}="value1";
> $item[0]{'key2'}="value2";
> $item[1]{'key1'}="value3";
> $item[1]{'key2'}="value4";
>
>I am trying to sort the array of items but I can't figure out how to swap
>items, for example, swapping item[0] and item[1] so that I end up with the
>data below.
>
> $item[1]{'key1'}="value3";
> $item[1]{'key2'}="value4";
> $item[2]{'key1'}="value1";
> $item[2]{'key2'}="value2";
>
>Thanks for your help
>Chris
>
>
>
------------------------------
Date: Sat, 22 Jul 2000 09:36:16 +0800
From: Yule Show <webmaster@lovergirl.com>
Subject: Re: To CGI.pm or not?
Message-Id: <shuhnscqtb0c7ohldoj0icgo36qqpqnevd@4ax.com>
Welcome to enjoy the CGI world.
Suppose you use ActiveState perl, there is a function or command
called ppm, let you connect to the distribution server and get the
newest CGI.pm, install is automatically.
yours Yule Show
On Sat, 22 Jul 2000 00:12:07 GMT, "DS" <snakeman@kc.rr.com> wrote:
>Hello I am a newbie at CGI scripting and I have read alot about CGI.pm but I
>am still a newbie so I am not sure whether to install it or just stick with
>writing my own scripts. What would you advise? Is CGI.pm really a good
>addition?
>
>Thanx alot
>Dirk
>
------------------------------
Date: Sat, 22 Jul 2000 00:29:23 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: To CGI.pm or not?
Message-Id: <brian-ya02408000R2207000029230001@news.panix.com>
In article <rF5e5.7291$t%4.79909@typhoon.kc.rr.com>, "DS" <snakeman@kc.rr.com> posted:
> Hello I am a newbie at CGI scripting and I have read alot about CGI.pm but I
> am still a newbie...
my general advice if you don't have any complaints about CGI.pm, then
CGI.pm is for you. when you have those complaints, you are ready for
the next level ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: 21 Jul 2000 22:51:10 EDT
From: abigail@foad.org (Abigail)
Subject: Re: uninitialized variable value?
Message-Id: <slrn8ni422.sif.abigail@alexandra.foad.org>
Jim Quinn (jq@usa.net) wrote on MMDXV September MCMXCIII in
<URL:news:8F77AFEE8jqusanet@64.252.33.231>:
|| How can i check in my program if a certain variable is unitialized?
You can't. Variables are initialized. *Values* however, can be unitialized.
Here's one way to test it:
eval 'local $^W = 1; "$certain_variable"';
if ($@ =~ /^Use of uninitialized value in string/) {
# Value is unitialized
}
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Sat, 22 Jul 2000 06:08:29 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: uninitialized variable value?
Message-Id: <397a39b0.1733468@news.newsguy.com>
abigail@foad.org (Abigail) wrote:
>Here's one way to test it:
>
> eval 'local $^W = 1; "$certain_variable"';
> if ($@ =~ /^Use of uninitialized value in string/) {
> # Value is unitialized
> }
Why does it say "uninitialized" there anyway rather than
"undefined"? If I initialize the variable and then later set it
to undef and use it, I still get the same warning.
I assume someone must be attached to the wording in the warning,
or it would have been fixed by now, but what's the rationale?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: 21 Jul 2000 22:52:58 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Where can I find more information
Message-Id: <slrn8ni45e.sif.abigail@alexandra.foad.org>
nikita (nikitta@ica.net) wrote on MMDXVI September MCMXCIII in
<URL:news:3977ED50.D6FF4C41@ica.net>:
__
__ Where can I find more information about Perl programming,
In the manual.
Abigail
--
New email address: abigail@foad.org
------------------------------
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 3774
**************************************