[17517] in Perl-Users-Digest
Perl-Users Digest, Issue: 4937 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 21 00:05:32 2000
Date: Mon, 20 Nov 2000 21:05:09 -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: <974783109-v9-i4937@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 20 Nov 2000 Volume: 9 Number: 4937
Today's topics:
Accessing NT shares from UNIX <tommoser@att.net>
Re: Accessing NT shares from UNIX (Martien Verbruggen)
Re: Command Line Perl (Chris Fedde)
Re: Command Line Perl (Martien Verbruggen)
Re: Command Line Perl (Logan Shaw)
Re: Command Line Perl <peter.sundstrom@eds.com>
Re: Command Line Perl (Chris Fedde)
Re: Cookieless operation (Vipul Ved Prakash)
Re: CSV Incrementing Question TIA!! (Chris Fedde)
Re: desperate pls help me! (Chris Fedde)
Re: Download image from a html page using perl CGI <bwalton@rochester.rr.com>
FTP - .jpg send problem mr_foosball@my-deja.com
Re: Help Me (Chris Fedde)
Help: multiple DB files, regular expressions, and subst (CloneTwo)
Re: Help: multiple DB files, regular expressions, and s (Chris Fedde)
Location Redirect (newbie help question) dogmac@my-deja.com
Re: Location Redirect (newbie help question) (Wyzelli)
Perl and uploading files... <scotto@consultant.com>
Re: PerlScript and ASP <toddm@waltz.rahul.net>
Re: Please tell me why this code is wrong (ActiveState <joe+usenet@sunstarsys.com>
Re: Please tell me why this code is wrong (ActiveState <joe+usenet@sunstarsys.com>
Re: starting a perl script as an NT service <g.chapman0749@home.com>
uploading files over web <troyr@vicnet.net.au>
Re: uploading files over web (Chris Fedde)
Re: using exec cgi in a perl program (Chris Fedde)
Re: What is a Junior Perl Programmer? (Wyzelli)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Nov 2000 03:31:23 GMT
From: "Big Vez" <tommoser@att.net>
Subject: Accessing NT shares from UNIX
Message-Id: <f0mS5.479$eU.26517@bgtnsc07-news.ops.worldnet.att.net>
I have several scripts that are currently running on a WindowsNT workstation
which can directly access files on the other NT servers using NT Share
directories (using simple Perl open commands). I want to migrate the script
to my UNIX server now, but I can't find an easy way to access these files.
Does anyone know how this can be accomplished.
The current syntax is pretty straightforward:
open(FILE, \\\\{server}\\{sharename}\\{file w/ path}); # ...
example "\\myserv\shareddir\logfiles\status.log"
It would be great if I could use this format when accessing the NT Servers
from UNIX because I also want to use 'opendir' and associated commands if
possible.
Someone mentioned Win32::Authenticate but I can't find any information on
that, so I assume that they are wrong, or the name is incorrect.
------------------------------
Date: Tue, 21 Nov 2000 04:12:47 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Accessing NT shares from UNIX
Message-Id: <slrn91jth0.r2.mgjv@verbruggen.comdyn.com.au>
On Tue, 21 Nov 2000 03:31:23 GMT,
Big Vez <tommoser@att.net> wrote:
> I have several scripts that are currently running on a WindowsNT
> workstation which can directly access files on the other NT servers
> using NT Share directories (using simple Perl open commands). I
> want to migrate the script to my UNIX server now, but I can't find
> an easy way to access these files. Does anyone know how this can be
> accomplished.
This works on Windows, because you have low level support for the
windows file sharing protocol, which is implemented with the SMB
network protocol.
To allow you to do that on Unix, a large part of the SMB protocol
would need to be implemented there. Most unices don't natively support
SMB. However, there's samba out there, and on some platforms it can
actually mount (via smbfs) SMB drives. If your Unix isn't one of those
systems, you'll have to use the smbclient.
ObPerl:
There is no direct support from Perl to do this. You could have a look
at the Filesys::SmbClientParser, available from CPAN. That module uses
smbclient (part of the samba distribution) to get to win32 shares.
However, if at all possible, I would just mount the thing, and access
the files on the mount.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Tue, 21 Nov 2000 02:38:12 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Command Line Perl
Message-Id: <oelS5.640$Bf7.190395904@news.frii.net>
In article <slrn91j7ou.r2.mgjv@verbruggen.comdyn.com.au>,
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>On Mon, 20 Nov 2000 16:07:11 GMT,
> Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>
>> perl -le 'print -A for @ARGV' *.*
>
>> anybody with better scores?
>
>Perl does globbing internally:
>
> perl -le 'print -A for <*.*>'
>
But it is smaller to do it externally
ls|perl -lpe's/$_/-A/e'
BTW. What anemic OS requires dot somewhere in a file name?
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 21 Nov 2000 03:26:31 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Command Line Perl
Message-Id: <slrn91jqq4.r2.mgjv@verbruggen.comdyn.com.au>
On Tue, 21 Nov 2000 02:38:12 GMT,
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
> In article <slrn91j7ou.r2.mgjv@verbruggen.comdyn.com.au>,
> Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>>On Mon, 20 Nov 2000 16:07:11 GMT,
>> Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>>
>>> perl -le 'print -A for @ARGV' *.*
>>
>>> anybody with better scores?
>>
>>Perl does globbing internally:
>>
>> perl -le 'print -A for <*.*>'
>>
>
> But it is smaller to do it externally
>
> ls|perl -lpe's/$_/-A/e'
Not very portable, is it? :) Won't work on win32 systems, for example,
unless you've got tools installed. Let me just try it on my system
here.
# cd /tmp
# ls | perl -lpe's/$_/-A/e'
a/ foo.pl* in mc.pipe.7490|
#
Hmmm... That didn't work at all right.
# ls -1 | | perl -lpe's/$_/-A/e'
8.20960648148148
4.19509259259259
0.898356481481482
*
0.193391203703704
3.95615740740741
4.11326388888889
|
1.06045138888889
88.0225810185185
389.888009259259
Hmmm.. still not entirely what I expected.
# \ls -1 | perl -lpe's/$_/-A/e'
8.20978009259259
4.1952662037037
0.898530092592593
1.08178240740741
0.193564814814815
3.95633101851852
4.1134375
382.928611111111
1.060625
88.0227546296296
389.88818287037
Finally! I just hope that that works everywhere and with all shells.
Damned aliases. Ok, now I can leave off the -1 again.
;)
> BTW. What anemic OS requires dot somewhere in a file name?
I just copied that, assuming that the specification called for files
that matched that pattern. The spec, however, asked for all files.
Neither yours nor mine will do that.
# \ls -a | perl -lpe 's/$_/-A/e'
or
# \ls -a | perl -lpe '$_ = -A'
or
# perl -le 'print -A for <.* *>'
Note that the order of the output may differ.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia |
------------------------------
Date: 20 Nov 2000 21:44:07 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Command Line Perl
Message-Id: <8vcr27$kpj$1@boomer.cs.utexas.edu>
In article <oelS5.640$Bf7.190395904@news.frii.net>,
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>In article <slrn91j7ou.r2.mgjv@verbruggen.comdyn.com.au>,
>Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>>On Mon, 20 Nov 2000 16:07:11 GMT,
>> Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>>
>>> perl -le 'print -A for @ARGV' *.*
>>
>>> anybody with better scores?
>>
>>Perl does globbing internally:
>>
>> perl -le 'print -A for <*.*>'
>
>But it is smaller to do it externally
>
> ls|perl -lpe's/$_/-A/e'
It's smaller and clearer to avoid the substitution:
ls|perl -lpe'$_=-A'
Also, for the low, low cost of one extra character, you can have it
print the names of the files as well, albeit in a slightly ugly fashion:
ls|perl -lpe'$_.=-A'
- Logan
------------------------------
Date: Tue, 21 Nov 2000 16:37:40 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Command Line Perl
Message-Id: <8vcqrq$v08$1@hermes.nz.eds.com>
Chris Fedde <cfedde@fedde.littleton.co.us> wrote in message
news:oelS5.640$Bf7.190395904@news.frii.net...
> In article <slrn91j7ou.r2.mgjv@verbruggen.comdyn.com.au>,
> Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> >On Mon, 20 Nov 2000 16:07:11 GMT,
> > Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
> >
> >> perl -le 'print -A for @ARGV' *.*
> >
> >> anybody with better scores?
> >
> >Perl does globbing internally:
> >
> > perl -le 'print -A for <*.*>'
> >
>
> But it is smaller to do it externally
>
> ls|perl -lpe's/$_/-A/e'
But not portable to Windoze unless you have Unix tools installed.
------------------------------
Date: Tue, 21 Nov 2000 04:21:30 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Command Line Perl
Message-Id: <eLmS5.649$Bf7.189528576@news.frii.net>
In article <slrn91jqq4.r2.mgjv@verbruggen.comdyn.com.au>,
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>
># perl -le 'print -A for <.* *>'
>
I thought to post one that used /bin/ls. That would get around the alias
issue. But it has the same score as your previous post.
I guess that if we are going to be truely cross platform then we'll
probably have to use opendir and its friends. Drat, There goes my
handicap. :-)
chris
--
This space intentionally left blank
------------------------------
Date: 21 Nov 2000 05:02:23 GMT
From: vipul@shell2.ba.best.com (Vipul Ved Prakash)
Subject: Re: Cookieless operation
Message-Id: <slrn91k0ev.rud.vipul@shell2.ba.best.com>
In article <3A12E377.AE89D6CF@lbl.gov>, Frank Hanny wrote:
>Sounds promising. Does CGI::Persistent work in a Windows NT server
>environment, as for example with MS IIS or is it strictly a Unix
>critter? (Note, this is not a request for advice and comments as to the
>superiority of Apache/Unix.)
>
>Thanks,
>
>Frank Hanny
Dunno. Why don't you try it? And if it works, drop me a note.
best,
vipul.
--
Vipul Ved Prakash, http://www.vipul.net/
PGP Fingerprint d5f78d9fc694a45a00ae086062498922
------------------------------
Date: Tue, 21 Nov 2000 02:12:11 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: CSV Incrementing Question TIA!!
Message-Id: <%RkS5.638$Bf7.189490688@news.frii.net>
In article <DWjS5.3349$qP3.346293@dfiatx1-snr1.gtei.net>,
Tim Goggin <tgoggin@unforgettable.com> wrote:
>Hi all!
>
> I'm modifying a perl script that opens a csv file and writes information
>to it.
>
> For example:
>
> "Item", "1", "22", "33", "455"
>
> What I need to do is have the script open the csv file, go to a specific
>line, find the item that needs to be changed and increment the number so it
>will now read:
>
> "Item", "2", "22", "33", "455"
>
> Does anyone know any perl code to do this? I would really appreciate any
>help.
>
>Thanks in advance,
>
>Tim
>
I've used Text::CSV_XS for similar stuff. Worked well for me.
--
This space intentionally left blank
------------------------------
Date: Tue, 21 Nov 2000 02:07:33 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: desperate pls help me!
Message-Id: <FNkS5.637$Bf7.190853632@news.frii.net>
In article <8vc17s$sgt@dispatch.concentric.net>,
M Lambert <mlambert@concentric.net> wrote:
>Im trying to write a cgi that will allow users to run a reporting tool and
>have the report emailed to them... the problem is the reports can take up to
>3 hours to generate. How do I background a process in Perl that will allow
>users to visit a cgi and leave while the pro finoishes up without them...
>ive exhausted all resources and am serioulsy considering opening a telent
>socket to THE SAME mahcine via the Perl CGI in order to "nohup runinit &".
>
>Any ideas???
>
It looks like you are doing this on a unixoid OS? Learn to use the at(1)
and batch(1) commands. They are your friends.
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 21 Nov 2000 02:06:02 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Download image from a html page using perl CGI
Message-Id: <3A19D93C.57AB58D6@rochester.rr.com>
jzhang_97@my-deja.com wrote:
>
> Is there a simple way to download a image
> file(.gif) from a web server with address:
>
> http://www.webserver.com/img.gif
>
> using perl CGI and saving it locally? I tried
> "lynx" and could not figure out a way doing
> it. I prefer doing it using standard
> Perl commands, if possible.
...
> -John
...
Why don't you juse use LWP::Simple? That's what it's for. See the
examples in perldoc LWP::Simple. If you're using Windoze, don't forget
binmode if you're writing the image to a file.
--
Bob Walton
------------------------------
Date: Tue, 21 Nov 2000 04:39:45 GMT
From: mr_foosball@my-deja.com
Subject: FTP - .jpg send problem
Message-Id: <8vcuah$mop$1@nnrp1.deja.com>
I have an FTP problem.
When I ftp 'put' a .jpg file from one windows system it doesn't seem to
work. The 6KB file is reduced to 1KB which is unreadable. I have
tried the $ftp->type(binary); and it doesn't change the outcome. I
have read through the ftp docs, and haven't come across anything.
Aslo, when I do the ftp manually it works (ascii or binary mode).
Thanks,
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 02:17:40 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Help Me
Message-Id: <8XkS5.639$Bf7.190240768@news.frii.net>
In article <8vbmu3$uko$1@newsg3.svr.pol.co.uk>,
Ian Waters <ian@ianwaters.com> wrote:
>Hi,
>I am creating a script for an on-line quiz, I can create the basic script
>which uses a conditional statement and prints html to say if the answer is
>correct or not, but I want to add a scoring system which tells the user how
>many questions they got correct.
>I am thinking about a scalar included in the conditional statement which
>adds up when the answer is correct. Is this the right way to go about it,
>if so can someone explain to me what to do or is this totally wrong, in
>which case can someone point me in the right direction.
>Also I want to display the scores of the last 10 people or even the 10
>highest scores, how do I do that?
>
I'm guessing that this is being done in a web context. And that all the
questions are posted on a single form. If this is true then a simple
scalar accumulator adding up the current score is fine.
To remember things between runs though your CGI script is going to have to
store data somewhere. Most of the time maintaining a simple text file is
enough.
This is really more a topic for a group that has CGI in its name though.
Good luck
chris
BTW: A better subject line can help lots.
--
This space intentionally left blank
------------------------------
Date: 21 Nov 2000 02:41:01 GMT
From: clonetwo@aol.com (CloneTwo)
Subject: Help: multiple DB files, regular expressions, and substitutions
Message-Id: <20001120214101.28156.00001652@ng-md1.aol.com>
Hi all,
I have a problem that I was hoping some of you could help me with.
I have two tab-separated database files: 'oldDBfile' and 'newDBfile'. Each
contains a list of over 15000 books. About 10% of the books in 'oldDBfile' have
an entry that contains a hyperlink, these books need to replace the same books
in 'newDBfile' (that do not have hyperlinks). Cutting and pasting 1500 book
entries by hand seemed like a very bad idea, so I thought I'd try to write a
perl script to solve the problem.
I started by extracting all of the books with links from the oldDBfile with:
#!perl
open(IN, 'oldDBfile') or die('could not open oldDBfile');
open(OUT, '>booklinks') or die('could not open booklinks');
while ($line = <IN>) {
if ($line =~ /http:/) {
print OUT ($line);
}
}
close(IN);
close(OUT);
This gives me the file 'booklinks' with all the books with hyperlinks form
'oldDBfile'. Since the first entry for each book is its ISBN number, the next
step should be a simple search and replace, something like:
"if the ISBN number of a book from 'booklinks' matches the ISBN number of a
book in 'newdbfile' the entry from 'booklinks' should replace the book in
'newdbfile'"
For some reason I'm having trouble writing the script for this part (most
likely because perl is a new language for me). I've been reading through the
"Camel Book" but I just can't get a handle on this.
My thanks in advance for any and all help,
Toni
------------------------------
Date: Tue, 21 Nov 2000 04:47:12 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Help: multiple DB files, regular expressions, and substitutions
Message-Id: <k7nS5.651$Bf7.171119104@news.frii.net>
In article <20001120214101.28156.00001652@ng-md1.aol.com>,
CloneTwo <clonetwo@aol.com> wrote:
>Hi all,
>
>I have a problem that I was hoping some of you could help me with.
>
>I have two tab-separated database files: 'oldDBfile' and 'newDBfile'. Each
>contains a list of over 15000 books. About 10% of the books in 'oldDBfile' have
>an entry that contains a hyperlink, these books need to replace the same books
>in 'newDBfile' (that do not have hyperlinks). Cutting and pasting 1500 book
>entries by hand seemed like a very bad idea, so I thought I'd try to write a
>perl script to solve the problem.
>
If the files will fit in memory then this becomes easy.
Conceptually:
Load the first file into a hash using ISBN as the key and the whole
record as the value.
Load the second file in exactly the same way.
second file entries will replace first file entries
Traverse the hash to output the updated file.
If the files don't fit into memory you can do something similar using a
DB_File based hash.
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 21 Nov 2000 04:20:49 GMT
From: dogmac@my-deja.com
Subject: Location Redirect (newbie help question)
Message-Id: <8vct6s$lsm$1@nnrp1.deja.com>
Hi, I am fairly new to perl, and was hoping someone might be able to
give me some idea on how to proceed. I have just inherited a portal
project that works thus:
On our site (A), we have a number of links to client site
When someone buys something from a client site (B), the confirmation
page has an image link. This does not actually go to an image, but to
a perl script on our site. We log the transaction, and then use the
Location header to redirect to an invisible image.
All fairly straightforward, if a little clunky.
The problem now arises where we now want to go to a third site (C) from
our perl script - this is to provide insurance for everyone who buys
through our site. They require me to send various variables through to
a page on their site, including a response site which they will return
to.
Does that make sense thus far?
B calls A, which calls C, which returns to A, which sends an image off
to B.
I had thought that I would be able to get away with this by simply
using Location: to the new URL (C). The problem with this is that
whenever I specify an html page (or an php one, which is what C is
using), any redirects, even if going to an image, cause an error to be
returned.
Does anyone have any brilliant ideas?
It could well be that I am trying to do this in utterly the wrong way.
Can anyone think of a way that I can send information to a URL, without
leaving a perl script (I couldn't apart from opening another window,
which isn't really an option), or do a redirect through perl other than
by using Location.
I can't change the pages on B, although I could change it so it looks
for a SSL, instead of an image. The whole concept of the client sites
is they only need to have one line of code, and not a whole lot of our
stuff on their site.
The image returned is only 1x1, and I admit that there have been times
when an evil bad coding part of me has wanted to go "Bugger it, I've
got the info I need", but I am sternly repressing that side in the hope
that someone else may be able to help the better side of me prevail.
Any ideas gratefully received!
Cheers
Di
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 05:04:12 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: Location Redirect (newbie help question)
Message-Id: <Xns8FF397F90wyzelliyahoocom@203.39.3.131>
dogmac@my-deja.com wrote in <8vct6s$lsm$1@nnrp1.deja.com>:
>Hi, I am fairly new to perl, and was hoping someone might be able to
>give me some idea on how to proceed. I have just inherited a portal
>project that works thus:
>
snip of faily detailed explaination.
It seems to me you need to look into the use of the LWP module and some of
its sub sections.
It is entirely possible to use a Perl script to access another page (submit
information) and then take the results and after massaging it print it back
to the first page.
It can be a little complex to ensure that the correct variables are passed
and parsing the return, but it is certainly possible.
Wyzelli
(trying a new newsreader...)
------------------------------
Date: Tue, 21 Nov 2000 04:43:57 GMT
From: "boxb" <scotto@consultant.com>
Subject: Perl and uploading files...
Message-Id: <h4nS5.21401$15.4979780@news1.rdc1.az.home.com>
I am somewhat new to perl. I have created a variaty of HTML forms and
associated perl scripts that allow for me to manage the content and layout
of a web page by using flat ASCII files and SSI. I want now to add the
ability to upload images from these forms to my web site. It seemed rather
simple at first, I just create a form using the <input type="file"
name="name"> tag and a submit button, right? Not so easy.... How in the
world do I parse the data? I use a simple subroutine on all my pages to
parse the incoming data, but it doesn't work on the file I want to upload.
all it returns is the name of the file I selected to upload. I've read
quite a bit on the net about the cgi-pl.lib and CGI.PM, and I've tried to
implement their solutions to no avail. The tutorials I've seen are too
high-level for me and assume I know more about perl than I actually do.
Anyone can help?
------------------------------
Date: 21 Nov 2000 02:52:11 GMT
From: Todd McLaughlin <toddm@waltz.rahul.net>
Subject: Re: PerlScript and ASP
Message-Id: <8vco0r$5d3$1@samba.rahul.net>
Solved it. I had to store the address of the array instead of the array
itself. Here's the working source code.
Todd
<%@ LANGUAGE = PerlScript %>
<HEAD>
<TITLE> Application Object </TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
hi
<%
my @var=qw(this is a test);
my $size = @var;
$Response->Write("<br>input: @var $size");
$Application->Contents->SetProperty('Item', 'MVar', \@var);
my $var2 = $Application->Contents->Item('MVar');
my @array2= @{$var2};
$Response->Write("<br>output: @array2");
%>
</BODY>
</HTML>
Todd McLaughlin <toddm@waltz.rahul.net> wrote:
: Mark W. Schumann <catfood@apk.net> wrote:
: : 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});
: But that doesn't work. In the following code, the value 3 gets stored in
: $Session->{'MyVar'} instead of the contents of the array. At least, that's
: what I think is happening.
: Any ideas?
: Thanks!
: Todd
: <%@ LANGUAGE = PerlScript %>
: <HEAD>
: <TITLE> Application Object </TITLE>
: </HEAD>
: <BODY BGCOLOR=#FFFFFF>
: hi
: <%
: my @array=("this", "is", "one");
: $Session->{'MyVar'} = @array;
: my @array2 = $Session->{'MyVar'};
: $Response->Write("output: @array2");
: %>
: </BODY>
: </HTML>
------------------------------
Date: 14 Nov 2000 16:44:48 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Please tell me why this code is wrong (ActiveState build 613 on Winblows)
Message-Id: <m3r94ep6sv.fsf@mumonkan.sunstarsys.com>
Jeff Zucker <jeff@vpservices.com> writes:
> dsteuber@my-deja.com wrote:
> >
> > I have a compile error that I do not understand. I have reduced
> > my code to the following short example. I am trying to run it on
> > an NT box, but I wrote it like a Unix Perl program out of habit.
>
> This has nothing to do with what OS you are running on.
>
> > my $foo_hash_ref = Foo::get_foo_hash();
> >
> > printf "%s\n", $foo_hash_ref{bar};
> >
> > Global symbol "%foo_hash_ref" requires explicit package name at test.pl
> > line 16.
>
> You forgot to de-reference $foo_hash_ref. When you write
> "$foo_hash_ref{bar} you are treating the hashref as if it were a plain
> hash. Walk down to the corner drugstore and buy yourself an arrow.
or trade the arrow in at the pawn shop for dollar sign:
$$foo_hash_ref{bar}
should also work.
--
Joe Schaefer
------------------------------
Date: 14 Nov 2000 16:14:42 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Please tell me why this code is wrong (ActiveState build 613 on Winblows)
Message-Id: <m3vgtqp871.fsf@mumonkan.sunstarsys.com>
dsteuber@my-deja.com writes:
> I have a compile error that I do not understand. I have reduced
> my code to the following short example. I am trying to run it on
> an NT box, but I wrote it like a Unix Perl program out of habit.
>
> ------------------------------------------------------------
> #!/usr/bin/perl -w
> use strict;
>
> package Foo;
>
> my %foo_hash = { bar => "baz" };
>
> sub get_foo_hash {
> return \%foo_hash;
> }
>
> package main;
>
> my $foo_hash_ref = Foo::get_foo_hash();
>
> printf "%s\n", $foo_hash_ref{bar};
>
> exit(0);
> ------------------------------------------------------------
>
Looks like you're short a dollar sign-
see if this helps:
printf "%s\n", $$foo_hash_ref{bar};
--
Joe Schaefer
------------------------------
Date: Tue, 21 Nov 2000 02:54:16 GMT
From: "Jack Altradmon" <g.chapman0749@home.com>
Subject: Re: starting a perl script as an NT service
Message-Id: <stlS5.145843$78.45092784@news3.rdc1.on.home.com>
Get hold of the book "Win32 Perl Scripting - The Administrator's Handbook"
by Dave Roth. Contains lots of excellent examples. To run a Perl Script as a
service you can use SRVANY from the NT Resource Kit ("the useful bit of NT
that Microsoft didn't include with the OS") or you can use the Daemon module
and write all the service manager interactions yourself.
Dave Roth also has an excellent web-site with information and example
scripts..
http://www.roth.net
Hope this helps..
Neil Trenholm <neil@alaweb.com> wrote in message
news:t1ifj7t6ustb0f@corp.supernews.com...
> Hello,
>
> If this is to the wrong group - please redirect me - I have looked for an
NT
> group - and may have missed it/them.
>
> I have looked through all of the perl docs and CPAN and the perl.org
> website - to no avail.
>
> I would like to start a perl script as a Windows NT service. If anyone has
> any suggestions or ideas I would be very grateful.
>
> Thanks,
> Neil
>
>
------------------------------
Date: Tue, 21 Nov 2000 15:17:16 +1100
From: "Troy Rasiah" <troyr@vicnet.net.au>
Subject: uploading files over web
Message-Id: <GImS5.38036$SF5.712544@ozemail.com.au>
Hi there...
I have a simple file uploading html/cgi page that uploads files to a
server. My problem is that I want a progress bar or even dots going across
the screen as the file uploads. My HTML only comes on the screen once the
file has finished uploading.
Can anyone help me?
Thanks in advance
This is basically what i'm using...the print statements don't show till the
file has finished uploading
sub uploadFile {
my ($fileonServer)=@_;
my $req = new CGI;
my $file = $req->param("fileToGo");
if ($file ne "") {
print "Now Uploading ";
my $fileName="$fileonServer";
open (OUTFILE, ">$fileName");
while (my $bytesread = read($file, my $buffer, 1024)) {
print ". ";
print OUTFILE $buffer;
}
close (OUTFILE);
}
}
--
----------------------------------------------------------------------------
----------------
TR
------------------------------
Date: Tue, 21 Nov 2000 04:27:50 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: uploading files over web
Message-Id: <aRmS5.650$Bf7.189025792@news.frii.net>
In article <GImS5.38036$SF5.712544@ozemail.com.au>,
Troy Rasiah <troyr@vicnet.net.au> wrote:
>Hi there...
> I have a simple file uploading html/cgi page that uploads files to a
>server. My problem is that I want a progress bar or even dots going across
>the screen as the file uploads. My HTML only comes on the screen once the
>file has finished uploading.
>
I think you need to unbuffer the output from the CGI. But this is more an
issue for the webserver than it is about perl. Maybe you can ask your
question in a group that has apache, iis, or some other relevent webserver
in it's name.
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 21 Nov 2000 02:57:14 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: using exec cgi in a perl program
Message-Id: <ewlS5.642$Bf7.189527552@news.frii.net>
In article <8vc853$4d5$1@nnrp1.deja.com>, <u0107@cheerful.com> wrote:
>Hello,
>
>The use of "exec cgi" command in an html file requires the renaming of
>the file with a "shtml" extension.
>
>My problem is that on my pages, html code is generated on the fly from
>cgi-bin directory using a perl program. To explain a little more, the
>URL reads something like:
>
>http://www.mysite.com/cgi-bin/myperl.pl?parameter_1=xxx
>
>myperl.pl uses the value of parameter_1 and generates html code based
>on the value.
>
>In the generated html code I need to use exec cgi.
>
>
>
>Part of the so-generated html code is a few lines of javascript which
>collects an inputted value - say a Zip Code - and "exec cgi"'s another
>perl program - say "get_zip_decode.pl?entered_zip=99999" - and puts the
>value in "document.form_name.field_name.value" which is a javascript
>variable.
>
>Hope to hear many innovative solutions in this forum.
>
>Cheers!
>
>Uttam
>
You seem to be mixing server side and client side functionality.
SSI is server side, javascript that collects user input is client
side. Can javascript cause an HTTP action and process the results
inside a page? Maybe this is a question that could be better
answered in a group that has javascript or js some where in its
name.
Good Luck
chris
--
This space intentionally left blank
------------------------------
Date: Tue, 21 Nov 2000 03:01:56 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: What is a Junior Perl Programmer?
Message-Id: <Xns8FF382A25wyzelliyahoocom@203.39.3.131>
Uri Guttman <uri@sysarch.com> wrote in <x7n1evdvcl.fsf@home.sysarch.com>:
>
> RLS> Not that I call myself a 10. I leave others to label me. :)
>
>no way are you as good looking as bo derek. i would rate you a 4.
>
>maybe a 6 after i have a few beers.
>
>:)
>
I have seen Randal's picture of himself with Sam Fox and harsh as I am I
would not even give Randal the 4... even after the beers... :)
Wyzelli
------------------------------
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 4937
**************************************