[17539] in Perl-Users-Digest
Perl-Users Digest, Issue: 4959 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 24 03:06:41 2000
Date: Fri, 24 Nov 2000 00:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975053113-v9-i4959@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 24 Nov 2000 Volume: 9 Number: 4959
Today's topics:
Re: CGI.pm upload problems mikhailgee@my-deja.com
Re: Checking if file exists (filename contains a wildca <krahnj@acm.org>
Re: Checking if file exists (filename contains a wildca (Rafael Garcia-Suarez)
Re: Checksum help please! <peter.sundstrom@eds.com>
Counter HELP <newsgroups@ebagus.com>
Re: Determining size of image <peter.sundstrom@eds.com>
dropping a / at the end of a string <linux@wizdom.org.uk>
Re: dropping a / at the end of a string <not.my.real.email@bellglobal.com>
Re: dropping a / at the end of a string (Martien Verbruggen)
Free script Classads,NewsWatch,Chat room <newsgroups@ebagus.com>
help with number comparsion <kf4dmb@net-magic.net>
Re: help with number comparsion <not.my.real.email@bellglobal.com>
Re: help with number comparsion (Tad McClellan)
Re: help with number comparsion <krahnj@acm.org>
Re: help with number comparsion (Wyzelli)
Re: help with number comparsion (Wyzelli)
Re: help with number comparsion <krahnj@acm.org>
Re: help with number comparsion (Martien Verbruggen)
Re: help with number comparsion <wyzelli@yahoo.com>
Re: IO::Socket: bind or listen errors <uri@sysarch.com>
Re: OOP and information hiding (Tad McClellan)
Re: OOP and information hiding <uri@sysarch.com>
Re: Perl DBI <corlando@MUNGEpop.phnx.uswest.net>
Re: perl2exe, does anybody know this software? <carvdawg@patriot.net>
Re: perl2exe, does anybody know this software? (Martien Verbruggen)
Re: PerlScript and ASP (Mark W. Schumann)
Remote File Access James@Antikythera_Machines.com.au
Remote File Access James@Antikythera_Machines.com.au
Script Request <jaymz@nucentrix.net>
Re: Site montior <not.my.real.email@bellglobal.com>
subroutine stuff <jaya_j_k@hotmail.com>
Subroutines in Perl??? <vidulats@yahoo.co.uk>
Re: Subroutines in Perl??? <atong@operamail.com>
test post - dont read Joe@nowhere.com
Re: Uploading .jpg files to server (Eric Bohlman)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Nov 2000 02:04:24 GMT
From: mikhailgee@my-deja.com
Subject: Re: CGI.pm upload problems
Message-Id: <8vkib7$7am$1@nnrp1.deja.com>
> Just curious, if you didn't use CGI.pm for upload just what did you
use?
The earlier script I'd been using was written by my programmer and
since there was no "use CGI" in the script, I just assumed it didn't
use CGI.pm.
Here's the code from the new script I'm trying to implement:
use CGI;
$num = 1;
while ($num != 5)
{
my $req = new CGI;
my $file = $req->param("FILE$num");
if ($file ne "")
{
my $filename = $file;
$filename =~ s!^.*(\\|\/)!!;
open (FILE, ">$dir/$filename");
print "$dir/$filename<br>";
while (my $bytesread = read($file, my $buffer, 1024))
{
print FILE $buffer;
}
close (FILE);
}
$num++;
}
> > I was wondering if anyone knows why my upload script using CGI.pm is
> > changing the uploaded filename whenever there are single quotes in
the
> > filename. For instance a filename like "Billie's Song.mp3" is
coming up
> > as "Billie::s Song.mp3".
>
> The return value from CGI::param() for an upload field is both a
> string and at the same time a filehandle.
>
> In older versions of CGI.pm this is achieved using symbolic references
> (ugh!).
>
> In more recent versions of CGI.pm this is achieved using hard
> references and overloading. (Still "ugh!", but less so).
>
> In older versions of Perl ' was used in place of :: so if you put ' in
> a symbolic reference and then look at the name of the resulting symbol
> you'll find that it has been converted to ::.
>
> # Print the name of the symbol who's name is "Billie's Song.mp3";
> print *{"Billie's Song.mp3"};
>
> I don't have an old version of CGI.pm to hand in order to explain in
> any greater detail the exact mechanism of this bug.
I really appreciate the explanation. I'll check on the version of perl
on my server and upgrade if I have to.
Thanks,
Mikhail
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 24 Nov 2000 04:21:15 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Checking if file exists (filename contains a wildcard)
Message-Id: <3A1DECFA.1DEBCE12@acm.org>
Ana Dominguez wrote:
>
> Hello,
>
> I have tried to use the -e function to determine if a file exists but my
> filename contains *s in its name. The function always returns false. Is
I just tried this and it does work.
> there a different function that can be used? Do I have to use the
> directory functions to determine if my file exists after getting the
> list of existing files under a directory?
Please show us your code.
John
------------------------------
Date: Fri, 24 Nov 2000 08:03:37 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Checking if file exists (filename contains a wildcard)
Message-Id: <slrn91s880.ojo.rgarciasuarez@rafael.kazibao.net>
Ana Dominguez wrote in comp.lang.perl.misc:
> Hello,
>
> I have tried to use the -e function to determine if a file exists but my
> filename contains *s in its name. The function always returns false. Is
> there a different function that can be used? Do I have to use the
> directory functions to determine if my file exists after getting the
> list of existing files under a directory?
-e "a*b" will check if a file exists in the current directory which name
is _actually_ a*b : filenames with stars are not forbidden on Unix,
they're just unusual (as filenames that begin with a dash).
> My program is trying to move files from one directory to another. The
> script runs on a Unix system and the only way to move the files seems to
> be by using a call to the Unix mv command. I read that there is supposed
> to be a move function as part of File::Copy module but I could not find
> it. The module installed on the system I am using does not have a "move"
> function.
Which version of Perl are you using? On perl 5.00503, File::Copy
includes a move function, a simple "perldoc File::Copy" gives the doc
for it.
Another way to move a file is to use the builtin function rename (but
read carefully the doc, there are caveats).
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
print map substr($_,7).&$_,grep defined &$_,sort values %::;
sub Just {' another '}; sub Perl {" hacker,\n"};
------------------------------
Date: Fri, 24 Nov 2000 14:01:35 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Checksum help please!
Message-Id: <8vkeli$3us$1@hermes.nz.eds.com>
Mike <mike@aol.com> wrote in message news:975023461.719577@tubarao.ip.pt...
> I'm new to perl and I want to create a checksum rotine that verifies if
any
> changes were made on an external data file.
>
>
> can anyone help me on this?
See http://search.cpan.org/doc/NWINT/MD5-1.7/MD5.pm
------------------------------
Date: Thu, 23 Nov 2000 15:27:40 +0800
From: "Plug-in tools" <newsgroups@ebagus.com>
Subject: Counter HELP
Message-Id: <8vl54r$daf$1@mango.singnet.com.sg>
open(countx,"<counter.txt") || print "ERROR NO SAVE";
$v_count=<countx>;
close(countx);
$v_count++;
&lock(countx);
open(countx,">counter.txt") || print "ERROR NO SAVE";
print countx $v_count;
close(countx);
&unlock(countx);
###################
sub lock {
my($name)=@_;
flock($name,LOCK_EX);
#and, in case someone appended
#while we were waiting...
seek($name, 0, 2);
}
sub unlock{
my($name)=@_;
flock($name,LOCK_UN);
}
##############
that is a problem when 2 user access at the same time,
my counter.txt will be reset to a different number.
anyone can help how to avoid the problem?
------------------------------
Date: Fri, 24 Nov 2000 14:09:14 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Determining size of image
Message-Id: <8vkf3t$4ko$1@hermes.nz.eds.com>
Dan Karran <dan@karran.net> wrote in message
news:8vkd4k$491$1@nnrp1.deja.com...
> Is there any way that I can find the height and width of an image through
> perl, by just giving it the location of the file?
See http://search.cpan.org/search?mode=module&query=Image%3A%3ASize
------------------------------
Date: Fri, 24 Nov 2000 02:40:24 +0000
From: Mark Worsdall <linux@wizdom.org.uk>
Subject: dropping a / at the end of a string
Message-Id: <2NXwXJAYUdH6Ew+q@worsdall.demon.co.uk>
Trying to work out how to drop the / character from the end of a string
$test = 'hello world/';
$test =~ s///;
Only I figure out what goes in between the ///.
Can I have an explanation rather than just an answer?
--
He came from Econet - Oh no, I've run out of underpants :(
Home:- jaydee@wizdom.org.uk http://www.wizdom.org.uk
Shadow:- webmaster@shadow.org.uk http://www.shadow.org.uk
Work:- netman@hinwick.demon.co.uk http://www.hinwick.demon.co.uk
------------------------------
Date: Fri, 24 Nov 2000 03:01:15 GMT
From: "MNJP" <not.my.real.email@bellglobal.com>
Subject: Re: dropping a / at the end of a string
Message-Id: <%RkT5.11197$xK.259411@news20.bellglobal.com>
"Mark Worsdall" <linux@wizdom.org.uk> wrote in message
news:2NXwXJAYUdH6Ew+q@worsdall.demon.co.uk...
>
> Trying to work out how to drop the / character from the end of a string
>
> $test = 'hello world/';
>
> $test =~ s///;
You want :
$test =~ s/\///;
To remote the first encountered \ from the string
$test =~ s/\///g;
To remove all occurances of a / in a string
$test =~ s/\/$//;
To remove the last character of a string only if it's a /
$test =~ s/\/+$//;
To remove the last character(s) of a string only if they're all / s
The reason \/ is used in the regular expression instead of just / is, as you
geussed it, the / is used as the delimiter (your empty regex shows that, the
first is the start, the second is the divider, the last is the end). If you
add just a / in the middle it will be mistaken for one of those three, so
you need to escape it by putting a \ behind it.
For an explanation of the other characters I used (+ and $) read the
documentation.
>
>
> Only I figure out what goes in between the ///.
>
> Can I have an explanation rather than just an answer?
>
> --
> He came from Econet - Oh no, I've run out of underpants :(
> Home:- jaydee@wizdom.org.uk http://www.wizdom.org.uk
> Shadow:- webmaster@shadow.org.uk http://www.shadow.org.uk
> Work:- netman@hinwick.demon.co.uk http://www.hinwick.demon.co.uk
------------------------------
Date: Fri, 24 Nov 2000 14:13:59 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: dropping a / at the end of a string
Message-Id: <slrn91rn7n.imr.mgjv@martien.heliotrope.home>
On Fri, 24 Nov 2000 03:01:15 GMT,
MNJP <not.my.real.email@bellglobal.com> wrote:
>
> "Mark Worsdall" <linux@wizdom.org.uk> wrote in message
> news:2NXwXJAYUdH6Ew+q@worsdall.demon.co.uk...
>>
>> Trying to work out how to drop the / character from the end of a string
>>
>> $test = 'hello world/';
>>
>> $test =~ s///;
>
> You want :
[snip]
> $test =~ s/\/$//;
> To remove the last character of a string only if it's a /
actually, in this case the OP probably wants
$test =~ s#/$##;
or some other characters. The delimiters to the s/// operator
are not limited to //, and can even be brackets and stuff. See the
perlop documentation for details.
When you have a / in your pattern, you immediately switch to another
delimiter, to avoid the leaning toothpick syndrome.
Martien
--
Martien Verbruggen | The Second Law of Thermodenial: In
Interactive Media Division | any closed mind the quantity of
Commercial Dynamics Pty. Ltd. | ignorance remains constant or
NSW, Australia | increases.
------------------------------
Date: Thu, 23 Nov 2000 15:19:35 +0800
From: "Plug-in tools" <newsgroups@ebagus.com>
Subject: Free script Classads,NewsWatch,Chat room
Message-Id: <8vl4lv$ia5$3@mango.singnet.com.sg>
Free script Classads,NewsWatch,Chat room
http://www.ebagus.com
------------------------------
Date: Thu, 23 Nov 2000 22:29:57 -0500
From: "jim flaherty" <kf4dmb@net-magic.net>
Subject: help with number comparsion
Message-Id: <3a1de4b4.0@206.30.194.5>
my code dont seam to work :
$count = "";
$count++;
if ($count eq 1) {
#do this
}
Help what am I doing wrong
------------------------------
Date: Fri, 24 Nov 2000 04:12:48 GMT
From: "MNJP" <not.my.real.email@bellglobal.com>
Subject: Re: help with number comparsion
Message-Id: <4VlT5.4635$2A2.285215@news20.bellglobal.com>
"jim flaherty" <kf4dmb@net-magic.net> wrote in message
news:3a1de4b4.0@206.30.194.5...
> my code dont seam to work :
>
> $count = "";
Try either "undef $count;" or "$count = 0;"
>
> $count++;
>
> if ($count eq 1) {
>
> #do this
>
> }
>
>
>
> Help what am I doing wrong
You're starting off with a string not an integer.
>
>
------------------------------
Date: Thu, 23 Nov 2000 23:14:07 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: help with number comparsion
Message-Id: <slrn91rqof.u3t.tadmc@magna.metronet.com>
MNJP <not.my.real.email@bellglobal.com> wrote:
>
>"jim flaherty" <kf4dmb@net-magic.net> wrote in message
>news:3a1de4b4.0@206.30.194.5...
>>
>> $count = "";
>
>Try either "undef $count;" or "$count = 0;"
Neither of which will make any difference.
Why do you think those would make a difference?
>> $count++;
>>
>> if ($count eq 1) {
>> Help what am I doing wrong
>
>You're starting off with a string not an integer.
And that is relevant how?
Perl's DWIMery does the Right Thing with the original code. It works fine.
There is something else that we weren't told...
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 24 Nov 2000 04:35:34 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: help with number comparsion
Message-Id: <3A1DF09D.7E92A5C2@acm.org>
jim flaherty wrote:
>
> my code dont seam to work :
>
> $count = "";
>
> $count++;
>
> if ($count eq 1) {
>
> #do this
>
> }
>
> Help what am I doing wrong
The code you posted does work, you must be doing something else wrong.
John
------------------------------
Date: Fri, 24 Nov 2000 05:10:35 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: help with number comparsion
Message-Id: <Xns8FF69F250wyzelliyahoocom@203.39.3.131>
"MNJP" <not.my.real.email@bellglobal.com> wrote in
<4VlT5.4635$2A2.285215@news20.bellglobal.com>:
>
>>
>> $count++;
>>
>> if ($count eq 1) {
This is the problem
>> #do this
>>
>> }
>>
>>
>>
>> Help what am I doing wrong
>
>You're starting off with a string not an integer.
>
Bzzzt Wrong! Try Again!
Perl will automagically convert between string and integer as needed.
The problem in this case is the string comparison rather than the numeric
comparison.
if ($count == 1){
#do stuff;
}
Wyzelli
--
#beer v2
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: Fri, 24 Nov 2000 05:11:50 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: help with number comparsion
Message-Id: <Xns8FF698CF7wyzelliyahoocom@203.39.3.131>
"John W. Krahn" <krahnj@acm.org> wrote in <3A1DF09D.7E92A5C2@acm.org>:
>jim flaherty wrote:
>>
>> my code dont seam to work :
>>
>> $count = "";
>>
>> $count++;
>>
>> if ($count eq 1) {
>>
>> #do this
>>
>> }
>>
>> Help what am I doing wrong
>
>The code you posted does work, you must be doing something else wrong.
>
Ah but it doesn't... (ie $count is always stringwise equal to 1)
The == comparison operator is needed
Wyzelli
--
#beer v2
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: Fri, 24 Nov 2000 05:21:12 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: help with number comparsion
Message-Id: <3A1DFB03.6AB80F9D@acm.org>
Wyzelli wrote:
>
> "John W. Krahn" <krahnj@acm.org> wrote in <3A1DF09D.7E92A5C2@acm.org>:
>
> >jim flaherty wrote:
> >>
> >> my code dont seam to work :
> >>
> >> $count = "";
> >>
> >> $count++;
> >>
> >> if ($count eq 1) {
> >>
> >> #do this
> >>
> >> }
> >>
> >> Help what am I doing wrong
> >
> >The code you posted does work, you must be doing something else wrong.
> >
>
> Ah but it doesn't... (ie $count is always stringwise equal to 1)
>
> The == comparison operator is needed
Ah but it does... Have you tried it? :)
John
------------------------------
Date: Fri, 24 Nov 2000 16:28:59 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: help with number comparsion
Message-Id: <slrn91rv4r.imr.mgjv@martien.heliotrope.home>
On Fri, 24 Nov 2000 04:12:48 GMT,
MNJP <not.my.real.email@bellglobal.com> wrote:
>
> "jim flaherty" <kf4dmb@net-magic.net> wrote in message
> news:3a1de4b4.0@206.30.194.5...
>> my code dont seam to work :
>>
>> $count = "";
>
> Try either "undef $count;" or "$count = 0;"
>
>> $count++;
>>
>> if ($count eq 1) {
>>
>> #do this
>>
>> }
While that is inelegant, and I'd say plainly silly, Perl will do the
'correct' thing. At least, it will in this case do what the poster
wanted, however much that may surprise you.
$ perl -wle 'my $x = ""; $x++; print $x'
1
The OP was simply mistaken, and should try again. But this time they
should start with
my $count = 0;
Not because the other way doesn't work, but because you should always
use numbers when you mean numbers, and strings when ou mean strings.
Unless, of course, you have a good reason not to, and you kno wwhat will
happen on the ocnversions.
Martien
--
Martien Verbruggen |
Interactive Media Division | Little girls, like butterflies, need
Commercial Dynamics Pty. Ltd. | no excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Fri, 24 Nov 2000 16:12:16 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: help with number comparsion
Message-Id: <B%nT5.38$9V1.2242@vic.nntp.telstra.net>
"John W. Krahn" <krahnj@acm.org> wrote in message
news:3A1DFB03.6AB80F9D@acm.org...
> Wyzelli wrote:
> >
> >
> > Ah but it doesn't... (ie $count is always stringwise equal to 1)
> >
> > The == comparison operator is needed
>
> Ah but it does... Have you tried it? :)
>
Ah but you are right and I was too quick.. :)
Still, number comparisons should use the numeric operator.
As Martien said, use numbers when you mean numbers and string when you
mean strings.
I shall slink off into a corner now...
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: Fri, 24 Nov 2000 04:45:14 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: IO::Socket: bind or listen errors
Message-Id: <x7hf4yc71i.fsf@home.sysarch.com>
>>>>> "u" == unformat <unformat@my-deja.com> writes:
u> When using IO::Socket and creating a socket object with ->new, I can
u> give args to make it listen on a port. I cannot, however, establish an
u> error condition following failure to bind to port using the ->error
u> method. How can I find out if the bind or listen failed within ->new() ?
are you checking the returned value? it will be true if a listen socket
is created, false (probably undef), otherwise. and what error method are
you referring to? IO::Socket doesn't mention that at all. what docs are
you using for this?
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Thu, 23 Nov 2000 23:06:26 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: OOP and information hiding
Message-Id: <slrn91rqa2.u1b.tadmc@magna.metronet.com>
Terrence Brannon <brannon@lnc.usc.edu> wrote:
>I think that a minimal acceptable definition of OOP is unifying
>functions and data into a single programmatic entity. By this
>definition, Perl does support OOP.
I could agree to that.
C supports OOP too then.
:-)
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 24 Nov 2000 05:53:12 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: OOP and information hiding
Message-Id: <x7aeapdign.fsf@home.sysarch.com>
>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:
TM> Terrence Brannon <brannon@lnc.usc.edu> wrote:
>> I think that a minimal acceptable definition of OOP is unifying
>> functions and data into a single programmatic entity. By this
>> definition, Perl does support OOP.
TM> I could agree to that.
TM> C supports OOP too then.
and so does macro assembler. i did basic OOP in macro-11 under RT-11
many years ago. passed around pointers to data blocks that only my
macros managed. no outside code touched them. OO at its simplest.
:)
the point being OO is in the mind and design, and not in the language
(even when the language is pure OO)
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 24 Nov 2000 00:45:37 -0700
From: "c" <corlando@MUNGEpop.phnx.uswest.net>
Subject: Re: Perl DBI
Message-Id: <5YoT5.5296$iM1.446721@news.uswest.net>
"Gil Vautour" <vautour@unb.ca> wrote in message
news:3A1D7337.89DEE353@unb.ca...
> Where can I find some info on "running the proxy"?
>
> c wrote:
>
> > "Gil Vautour" <vautour@unb.ca> wrote in message
> > news:3A156887.E2E7712E@unb.ca...
> > > Hi all,
> > >
> > > I have been doing some research on Perl and the DBI module, but I
still
> > > have a few questions... The following is my situation and I'm
wondering
> > >
> > > if it is even possible and am I on the right track. I have Perl
running
> > >
> > > on Unix with an Apache webserver, and I also have a Win98 PC on the
> > > network that is running 24/7. Would I be able to use Perl with the
DBI
> > > module to access a MS Access database on the windows PC? If the ODBC
> > > DSN is setup on the PC would I be able to connect to the database
using
> > > Perl? If so, how do I specify the where the PC and database are using
> > > something like :
> > > my $dbh = DBI->connect( "dbi:???", "username", "password" )
> > >
> > > Thanks
> > >
> >
> > You might be able to install the ActiveState distro on the 98 machine
and
> > run the proxy. It worked fine for me but I used a Linux NT combination.
>
It's right in the Activestate Perl docs when you install. Read the docs.
------------------------------
Date: Thu, 23 Nov 2000 22:50:46 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: perl2exe, does anybody know this software?
Message-Id: <3A1DE596.8A49E73A@patriot.net>
> I've found perl2exe utility for perl developers.
I use it a lot. I've a registered copy of the Pro version.
> From what I've read it compiles everything into one single file.
It doesn't have to. You can use the '-tiny' switch to reduce the size
of the .exe file,
and then ship it with the separate .dlls it generates. This is
extremely useful if you have
Perl script that all use the same modules via 'use' or 'require'
statements.
> This seems good to avoid curious people from changing or selling my
> programs.
I don't know about selling...but I like to use it to give people the
chance to run the
scripts I write, but they don't want to install Perl.
> Does anybody heard about this software? is it good? any comments?
It's excellent. Far superior to the AS development stuff.
------------------------------
Date: Fri, 24 Nov 2000 16:30:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: perl2exe, does anybody know this software?
Message-Id: <slrn91rv7j.imr.mgjv@martien.heliotrope.home>
On Thu, 23 Nov 2000 22:50:46 -0500,
H C <carvdawg@patriot.net> wrote:
>> I've found perl2exe utility for perl developers.
>
> I use it a lot. I've a registered copy of the Pro version.
>
>> From what I've read it compiles everything into one single file.
>
> It doesn't have to. You can use the '-tiny' switch to reduce the size
> of the .exe file,
> and then ship it with the separate .dlls it generates. This is
> extremely useful if you have
yes. Very useful. The only excuse that perl2exe had to exist was that
you only had to ship one binary, and could avoid installing perl on all
machines. Then they start splitting it up in multiple binaries.
Now where is the use in that?
Just install Perl.
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 23 Nov 2000 23:29:16 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: PerlScript and ASP
Message-Id: <8vkqqs$61i@junior.apk.net>
In article <m31yw7tmdx.fsf@mumonkan.sunstarsys.com>,
Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
>catfood@apk.net (Mark W. Schumann) writes:
>
>> In article <8v9vkb$i5n$1@samba.rahul.net>,
>> Todd McLaughlin <toddm@waltz.rahul.net> wrote:
>> >The folowing code lets me store a value in the application data. How do I
>> >do this if I want to store an array instead of a single value? Say I had
>> >@var1 instead of $var1.
>>
>> $ man perldata
>>
>> One example:
>>
>> @var1 = ('one thing', 'another', 0xdeadbeef, {1,2,3});
> ^^^^^^^
>ITYM [1,2,3] here.
Oops. Yes. You're right.
------------------------------
Date: 24 Nov 2000 05:07:59 GMT
From: James@Antikythera_Machines.com.au
Subject: Remote File Access
Message-Id: <8vkt3f$u08$1@news.netmar.com>
My first real foray into Pearl programming has been a CGI interface for a
mysql database.
I need for users to be able to upload a data file from the client machine and
have the CGI program able to process this data before inserting the data into
the database.
Can someone point me in the right direction of some information on remote
file
access, or let me know if what i want to achieve is infesiable.
James
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 24 Nov 2000 05:39:54 GMT
From: James@Antikythera_Machines.com.au
Subject: Remote File Access
Message-Id: <8vkuva$vbm$1@news.netmar.com>
My first real foray into Pearl programming has been a CGI interface for a
mysql database.
I need for users to be able to upload a data file from the client machine and
have the CGI program able to process this data before inserting the data into
the database.
Can someone point me in the right direction of some information on remote
file access, or let me know if what i want to achieve is infesiable.
James
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: Thu, 23 Nov 2000 23:27:51 -0600
From: "PotatoeHead" <jaymz@nucentrix.net>
Subject: Script Request
Message-Id: <f2nT5.1554$xb1.94104@eagle.america.net>
I'm looking for a script, Java and/or cgi, that I can use to grade a persons
answers with AFTER the NFL games are played.
Basically it needs to work like this, I put in what the totals are.
EXAMPLE: Dallas/Minnesota 48
NYGiants/Washington 37
and on and
on and on
The person picks 5 of the games to go "over or under" the total #. When the
game is over I can go and enter what the score was, the script adds up the
pts. and tells how many each person got correct.
Any idea as to where I can find something like this?
Signature ------------------------------------------------------------------
-------- Add the HumanClick "Click to Chat" button to your own e-mails for
free at www.humanclick.com
------------------------------
Date: Fri, 24 Nov 2000 03:05:12 GMT
From: "MNJP" <not.my.real.email@bellglobal.com>
Subject: Re: Site montior
Message-Id: <IVkT5.11204$xK.259304@news20.bellglobal.com>
It depends what exactly you want to check for.
If you just want to check the machine is on the network or not, you want a
module that will ping it.
If you want to check if a machine is running a specific service (web server,
ftp, etc) you'll want a module that's dedicated to that protocol.
Head over to http://search.cpan.com and search for any modules you want. For
the first case do a search for "ping".. For the second case do a search for
a module named after the protocol you want to test. (ftp, http, etc..)
If you're really adventurous you can also give IO::Socket a shot where you
can write your own script that connects and communications back and forth
with any server running over TCP.
"Brian Canning" <webmaster@ukdj.freeserve.co.uk> wrote in message
news:8vkgej$g8o$2@newsg2.svr.pol.co.uk...
> Hi there
>
> I posed a question up a few weeks, back asking
> if there was any way to write a script to test is
> a site is working/up.
> I did get one reply telling me off a perl module
> that could help me do this.
>
> the trouble is I have had a system crash and lost all
> emails.
>
> if anybody can help with this script or knows of a module
> that can do this please could you let me known.
>
> Thanks
>
> Brian
>
>
>
>
------------------------------
Date: Fri, 24 Nov 2000 07:30:05 -0000
From: jaya <jaya_j_k@hotmail.com>
Subject: subroutine stuff
Message-Id: <t1s67t7090o174@corp.supernews.com>
Hi PerlExperts,
I want a solution for the following problem :
I want my subroutine as shown
Foo ($Val1, %Elements, $Time);
Inside the Foo function :
sub Foo
{
($myv, %mye, $myt) = @_;
# Here I want to modify the values of the "mye" hash
and I want that the same values to the reflected back to the calling
function.
#But I don't want
%Elements = Foo ($Val1, %Elements, $Time)
# How do I do that
}
I tried in the following way:
In the following program:
#!/usr/bin/perl5 -wl
use Tie::IxHash;
tie( %Message, 'Tie::IxHash',
'Message_Type' => 0,
'Message_discriminator' => 0,
'Message_Value' => 0,
'Message_Data' => 0
);
$Status = Foo1(%Message);
foreach $val (sort keys %Message)
{ print "\n $val , $Message{$val}";}
print "\nStatus = ", $Status;
$Status = Foo2(%Message);
foreach $val (sort keys %Message)
{ print "\n $val , $Message{$val}"; }
print "\nStatus = ", $Status;
sub Foo1
{ $i = 1;
foreach $val (sort keys %$_)
{ $$_{$val} = $i;
$i++;
}
return 0;
}
sub Foo2
{ $i = 1;
foreach $val (sort keys %Message)
{ $Message{$val} = $i;
$i++;
}
return 0;
}
When I'm printing the values of the Hash after Foo1 subroutine I'm getting
output as all zero's.
And After the Foo2 subroutine I'm getting output as per my requirement.
I know in Foo2 subroutine I used the same name of the passed paramter,
that's why I'm getting the values.
Will any one help me solving the problem
Thanks in advance,
Regards,
Jaya
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Fri, 24 Nov 2000 05:30:06 -0000
From: <vidulats@yahoo.co.uk>
Subject: Subroutines in Perl???
Message-Id: <t1rv6u48ellue9@corp.supernews.com>
Hi PerlExperts,
My question is:
I want to write one subroutine like
Receive ($Val1, %Elements, $Time);
Inside the Receive function :
sub Receive
{
($myv, %mye, $myt) = @_;
# Here I want to modify the values of the "mye" hash
and I want that the same values to the reflected back to the calling
function.
#But I don't want
%Elements = Receive ($Val1, %Elements, $Time)
# How do I do that
}
Will anyone guide me.
Thanks in advance,
Regards,
Vidula
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Fri, 24 Nov 2000 14:58:08 +0800
From: "meow" <atong@operamail.com>
Subject: Re: Subroutines in Perl???
Message-Id: <8vl3i6$gn2@news.or.intel.com>
i'm quite sure what you want.... from my intepretation, you wan to return
back teh hash from the subroutine... here is the way...
sub Receive {
my($myv, %mye, $myt) = @_;
# your code here... bla bla bla.....
return(%mye);
}
vidulats@yahoo.co.uk wrote in message ...
>Hi PerlExperts,
>
>My question is:
>I want to write one subroutine like
>Receive ($Val1, %Elements, $Time);
>
>Inside the Receive function :
>sub Receive
>{
> ($myv, %mye, $myt) = @_;
> # Here I want to modify the values of the "mye" hash
> and I want that the same values to the reflected back to the calling
>function.
> #But I don't want
> %Elements = Receive ($Val1, %Elements, $Time)
> # How do I do that
>}
>
>Will anyone guide me.
>
>Thanks in advance,
>
>Regards,
>Vidula
>
>
>--
>Posted via CNET Help.com
>http://www.help.com/
------------------------------
Date: 24 Nov 2000 05:34:55 GMT
From: Joe@nowhere.com
Subject: test post - dont read
Message-Id: <8vkulv$v4j$1@news.netmar.com>
test
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 24 Nov 2000 05:14:36 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Uploading .jpg files to server
Message-Id: <8vktfs$1ec$1@bob.news.rcn.net>
Dan Yllanes <DanYllanes@netzero.net> wrote:
> I am trying to implement a script to upload .jpg files to a server. Here
> is the script:
> #!/usr/local/bin/perl
> use CGI qw/:standard/;
> use CGI::Carp qw(fatalsToBrowser);
> $CGI::POST_MAX=1024 * 100;
> $file_name = param('IMAGE');
> print header('image/gif');
> open (MYFILE, ">http://www.eco-interiors.com/products/$file_name");
There's your problem. You simply can't treat a URL as an ordinary
file. You have to establish a connection to the remote server and use
whatever protocol it wants to send the file. If the remote server wants
an HTTP connection for the upload, you'll probably want to use LWP to do
the work. Read the LWP cookbook (included with the LWP modules) to see
how to do this.
------------------------------
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 4959
**************************************