[9448] in Perl-Users-Digest
Perl-Users Digest, Issue: 3043 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 2 01:07:26 1998
Date: Wed, 1 Jul 98 22:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 1 Jul 1998 Volume: 8 Number: 3043
Today's topics:
\d versus [0-9] (Mark-Jason Dominus)
Re: Debug ? (brian d foy)
Re: find a number with regular expression (Tad McClellan)
FORMAT in MacPerl (Alan H. Stein)
Re: I NEED SOME HELP (Tad McClellan)
Re: ICE - Search engine (brian d foy)
Re: need a script (Tad McClellan)
Re: perl and environment parameters?? (brian d foy)
Re: perl newbie Q: Any ideas why this doesn't work? <jeremy@exit109.com>
Re: perl newbie Q: Any ideas why this doesn't work? (Martien Verbruggen)
perl vs javascript for field validation <pwhite@nospamsurfsouth.com>
Re: perl vs javascript for field validation (brian d foy)
Re: problem with system and ftp (Larry Martell)
Re: problem with system and ftp (Larry Martell)
Re: require $redir.'setup.pl'; ?? <pwhite@nospamsurfsouth.com>
Re: Running Unix Script in Perl (brian d foy)
Re: Testing perl knowledge (David Adler)
Re: Uploading image files <webmaster@triologic.com>
Re: Vertical Perl <mgregory@asc.sps.mot.com>
Re: while (<CSV_FILE>) doesn't work with NT (Bob Trieger)
Re: while (<CSV_FILE>) doesn't work with NT (Stephen L. Vinson)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Jul 1998 23:07:00 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: \d versus [0-9]
Message-Id: <6netgk$6sr$1@monet.op.net>
Keywords: hyphen lovebird ninefold transgress
In article <NEWTNews.899328673.11610.howard@howardnt2>,
<howard@wdsec.com> wrote:
>In pattern matching checking against a variable
>
>$SOURCE =~ /$CHECK/
>
>works for $CHECK="[0-9]"
>but fails for $CHECK="\d"
>but works for
>
>$SOURCE =~ /\d/
>
>Does anyone have an explanation?
\ is special in double-quoted strings. If you write
$CHECK = "\d"
that's the same as
$CHECK = "d"
You should either use
$CHECK = '\d';
or $CHECK = "\\d";
------------------------------
Date: Wed, 01 Jul 1998 22:16:15 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Debug ?
Message-Id: <comdog-ya02408000R0107982216150001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6neodv$8lr$1@nnrp4.snfc21.pbi.net>, "Darren Sweeney" <darrensw@pacbell.net> posted:
>I have a script which returns the '500 Internal error' message.
>
>What is the best way to debug...I have tried telnet perl -c/w but they both
>tell me the script is OK.
the CGI Meta FAQ has a reference to "Idiot's Guide to Solving Perl
CGI Problems" by Tom C.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
------------------------------
Date: Wed, 1 Jul 1998 22:47:29 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: find a number with regular expression
Message-Id: <hsven6.q51.ln@localhost>
Patrick Timmins (ptimmins@netserv.unmc.edu) wrote:
: In article <3599E169.DACB46B@emw.ericsson.se>,
: Robert.Rehammar@emw.ericsson.se wrote:
: > How do I find out if a srtring contains a number with $string[0]=~/???/.
: So you mean you have an array called @string, and you want to know when any
: of its elements contains a number? If so, how about something like:
: @string = ('dog', 'cat', '2 mice', 'dirty rat');
: $idx = 0;
: foreach $string (@string) {
: ($string =~ /\d/) && print "\$string[$idx] has a number in it: $string\n";
: $idx++;
: }
Or, for those who would rather use a pre-existing wheel rather
than invent it again:
--------------------
#!/usr/bin/perl -w
@string = ('dog', 'cat', '2 mice', 'dirty rat');
foreach (grep /\d/, @string) {
print "'$_' has a number in it.\n";
}
--------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 01 Jul 1998 23:50:05 -0400
From: steina@member.ams.org (Alan H. Stein)
Subject: FORMAT in MacPerl
Message-Id: <6nevvi$nmp@bgtnsc03.worldnet.att.net>
I've been trying to use a format in MacPerl 4.1.3. A sample attempt is:
Program begins on next line.
#!/bin/perl
$~ = "TheFormat";
write;
format TheFormat =
This is a test.
.
Program ended on the line above, containing only a period.
When I run it, I get the following error message (line 8 is the line
containing just a period):
# Format not terminated, next char ^?
File '<AppleEvent>'; Line 8
# Execution of <AppleEvent> aborted due to compilation errors.
--
http://www.math.uconn.edu/~stein
------------------------------
Date: Wed, 1 Jul 1998 23:08:50 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I NEED SOME HELP
Message-Id: <i41fn6.q51.ln@localhost>
David (dcunningham@detnet.com) wrote:
> Subject: I NEED SOME HELP
You will be much more likely to get help if you refrain
from SHOUTING at us.
Actually putting a subject in your Subject: would be Really Good too...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 01 Jul 1998 22:05:24 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: ICE - Search engine
Message-Id: <comdog-ya02408000R0107982205240001@news.panix.com>
Keywords: from just another new york perl hacker
In article <Wtlm1.2320$606.12187433@news.rdc1.ab.wave.home.com>, "Jason" <jbrackman@hotmail.com> posted:
>Thank you for response. I had though that the Aliases would probably have
>something to do with the correct mapping of directories... but so far it is
>still not working.
>
>$docroot = '\program files\xitami\webpages\database\upload';
>
>%aliases = (
> '/upload', '\program files\xitami\webpages\database\upload',
> '/eng3x', '\program files\xitami\webpages\database\upload/eng3x',
> '/eng1x', '\program files\xitami\webpages\database\upload/eng1x',
>);
>
>This is what I have in that section... unfortunately, the webpages are all
>indexed properly but the links are not produced correctly. I would get
>something like:
>
>english.dyn.ml.org/log.htm
>
>when it should really say
>
> english.dyn.ml.org/database/upload/log.htm
>
>Any further assistance would be appreciated.
[NB: i've never used this software, and do not intend to]
from <URL:http://www.informatik.tu-darmstadt.de/~neuss/
ice/right/ice2-for.pl>
# Document Root and Aliases for your server. The Document Root is
# the directory where the "top level" documents reside. Additional
# mappings can be set via the "Aliases" variable (which can be left
# empty if no additional mappings exist).
#
# Important hint: if you are unsure about how to set $docroot,
# look at the end of the index file. $docroot must be set so
# that it matches the paths found there.
#
# Example
# $docroot = '/usr3/webstuff/documents';
# %aliases = (
# '/projects', '/usr/stud/proj',
# '/people', '/usr3/webstuff/staff',
# );
#
$docroot = '/users/neuss/Projects';
%aliases = (
'/~neuss/', '/Users/neuss',
);
it appears, in your case, that you want
$docroot = '\program files\xitami\webpages';
so that later in
# translate physical to URL
sub translateback {
when the absolute path is translated to the URL with
if(!$aliasdone && $docroot){
s/$docroot//;
}
the '\database\upload' portion of the URL is not disappeared.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
"it's not even correct grammar" - Yossarian, on "disappeared"
------------------------------
Date: Tue, 30 Jun 1998 22:02:41 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: need a script
Message-Id: <hs8cn6.fgi.ln@localhost>
Raven (raven1@hotmail.com) wrote:
: anyone have a script that records how many times a file has been
: downloaded, and then puts on a webpage that number?
Yes.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 01 Jul 1998 22:14:27 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl and environment parameters??
Message-Id: <comdog-ya02408000R0107982214270001@news.panix.com>
Keywords: from just another new york perl hacker
In article <01bda4ba$5b2278a0$e9bffcc1@SIT.wanadoo.fr>, "DUTOIT" <abcdm@wanadoo.fr> posted:
>I want to know all the environment parameters like PATH wich are used like
>that:
look in the %ENV hash:
foreach ( sort keys %ENV ) { print "$_: $ENV{$_}\n" }
>$oldPATH=$ENV{"PATH"};
>For example, I'm looking for how to know the current directory.
does the Cwd module work for you? it's part of the Standard Perl
Library. (`perldoc Cwd` for details).
>More,I want to use secured payment online (SSL). I'm looking for how to
>put https://... instead of http://...
are we beating a dead horse?
you need a secure server, which then does everything for you so that
no change in your script is required (save for the s/http:/https:/g
for references).
i like Stronghold [1] with mod_perl myself.
bon chance :)
[1] Stronghold <URL:http://www.c2.net>
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
------------------------------
Date: 2 Jul 1998 03:19:13 GMT
From: Jeremy <jeremy@exit109.com>
Subject: Re: perl newbie Q: Any ideas why this doesn't work?
Message-Id: <6neu7i$5vs$1@news1.exit109.com>
Jeffrey Kaplan <jkaplan@world.std.com> wrote:
> ; 2. Your script isn't set to be excutable, but you are assuming it (OUCH!)
> ; => set your file to be executable (man chmod)
>
> -rwxrwx--- 1 jkaplan jkaplan 127 Jul 1 02:59 test*
Aha. For a few laughs, type 'which test'.
Then try './test'.
Then don't call your test programs 'test' ever again. :)
--
Jeremy | jeremy@exit109.com
The customer is always right, until he tries to say something.
------------------------------
Date: 2 Jul 1998 02:52:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl newbie Q: Any ideas why this doesn't work?
Message-Id: <6neslm$h57$1@comdyn.comdyn.com.au>
In article <359bb7b6.4743765@news.std.com>,
jkaplan@world.std.com (Jeffrey Kaplan) writes:
> -rwxrwx--- 1 jkaplan jkaplan 127 Jul 1 02:59 test*
How is your path set up? Do you maybe have /usr/bin and/or /usr/ucb in
your path before .? Are you aware that there is a unix command 'test',
which lives in above mentioned directories?
If you want to make sure that that script gets executed, give it a
full path name, or a relative one:
# ./test
Martien
PS. This, of course, has nothing at all to do with perl.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd. | things get worse.
NSW, Australia |
------------------------------
Date: Wed, 1 Jul 1998 22:14:00 -0400
From: "Penn White" <pwhite@nospamsurfsouth.com>
Subject: perl vs javascript for field validation
Message-Id: <359aed17.0@news.surfsouth.com>
I am creating a 'cascading' series of perl scripts which end with
'print'-ing
the next html form document until all the information required is collected.
In each html form/page, there are fields in the form that must be validated
before the user goes on to the next form/page.
I am considering doing this validation with javascript whenever possible
since with javascript, errors are recognized immediately (before the
'submit' button is pressed).
Does anyone see any problems with this?
Including javascript code in my 'print' statements significantly enlarges
the
size of the code for the html document. Will increasing the size of the
html
document created by the perl script increase the time required to go on to
the next page to an appreciable (by the user) degree?
Does anyone remember the oldest MSIE version that supports javascripting?
I know that Netscape v 2.0 and higher will support it. Do any other
browsers
support javascript?
I actually find the 'alert' boxes in javascript somewhat irritating. Does
anyone
know of any 'user satisfaction' surveys that have been done which indicate
whether users would prefer having immediate alerts if their input is
incorrect
vs having the perl script do the validation and generate another page that
points out the errors and makes them use the 'back' button to correct them?
If you don't know of any surveys that have been done, what is your personal
preference?
What are your thoughts on the overall design concept? Personally, I don't
like
to have to scroll down a huge page when filling out a form. I would prefer
to
have a bunch of successive (nearly) single screen pages that move logically
from one to the next. This also has the advantage of allowing the next
displayed screen to be customized based on input from the preceding one.
TIA,
Penn White
------------------------------
Date: Wed, 01 Jul 1998 22:33:38 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl vs javascript for field validation
Message-Id: <comdog-ya02408000R0107982233380001@news.panix.com>
Keywords: from just another new york perl hacker
In article <359aed17.0@news.surfsouth.com>, "Penn White" <pwhite@nospamsurfsouth.com> posted:
>I am considering doing this validation with javascript whenever possible
>since with javascript, errors are recognized immediately (before the
>'submit' button is pressed).
>
>Does anyone see any problems with this?
even with Javascript, your script should still check the data to
make sure that it is what the script is expecting. never count on
the client to send good data :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
------------------------------
Date: Thu, 02 Jul 1998 02:17:14 GMT
From: larrym@imsi.com (Larry Martell)
Subject: Re: problem with system and ftp
Message-Id: <6neqir$lbv@titan.imsi.com>
In article <EvFz6r.EEA@news.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>In article <6neeep$l33@titan.imsi.com>, Larry Martell <larrym@imsi.com> wrote:
>>I have a file, call it ftp.in, with some ftp commands:
>>
>>open remote_host
>>user user passwd
>>ascii
>>cd /some/dir
>>put testFile
>>get testFile /tmp/GetItBack
>>bye
>>
>>And from perl I want to: system("/usr/ucb/ftp -in < ftp.in")
>>
>>Should work, right? If I invoke that same command from the shell it works.
>>Well, from perl it hangs - ftp is prompting for a passwd.
>>
>>I've found that perl invokes "sh -c /usr/ucb/ftp -in < ftp.in", and if I run
>>that it indeed hangs:
>>
>># sh -c /usr/ucb/ftp -in < ftp.in
>>Password:
>>
>>I found that if I quote it thusly: sh -c "/usr/ucb/ftp -in < ftp.in" it does
>>work from the shell, but if I change the system command to:
>>
>>system("'/usr/ucb/ftp -in < ftp.in'")
>>
>>It complains:
>>
>>sh: /usr/ucb/ftp -in < ftp.in: not found
>>
>>How can I system this from perl?
>What happens if you say:
>
>system("exec /bin/sh -c '/usr/ucb/ftp -in < ftp.in'");
Nope, still hangs. Ultimately, it's still invoking:
/bin/sh -c /usr/ucb/ftp -in < ftp.in
larry
--
Larry Martell "When I do good, I feel good. When I do bad,
larrym@imsi.com I feel bad. And that is my religion."
------------------------------
Date: Thu, 02 Jul 1998 03:09:59 GMT
From: larrym@imsi.com (Larry Martell)
Subject: Re: problem with system and ftp
Message-Id: <6netlo$lff@titan.imsi.com>
In article <6neqir$lbv@titan.imsi.com>, Larry Martell <larrym@imsi.com> wrote:
>In article <EvFz6r.EEA@news.boeing.com>,
>Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>>In article <6neeep$l33@titan.imsi.com>, Larry Martell <larrym@imsi.com> wrote:
>>>I have a file, call it ftp.in, with some ftp commands:
>>>
>>>open remote_host
>>>user user passwd
>>>ascii
>>>cd /some/dir
>>>put testFile
>>>get testFile /tmp/GetItBack
>>>bye
>>>
>>>And from perl I want to: system("/usr/ucb/ftp -in < ftp.in")
>>>
>>>Should work, right? If I invoke that same command from the shell it works.
>>>Well, from perl it hangs - ftp is prompting for a passwd.
>>>
>>>I've found that perl invokes "sh -c /usr/ucb/ftp -in < ftp.in", and if I run
>>>that it indeed hangs:
>>>
>>># sh -c /usr/ucb/ftp -in < ftp.in
>>>Password:
>>>
>>>I found that if I quote it thusly: sh -c "/usr/ucb/ftp -in < ftp.in" it does
>>>work from the shell, but if I change the system command to:
>>>
>>>system("'/usr/ucb/ftp -in < ftp.in'")
>>>
>>>It complains:
>>>
>>>sh: /usr/ucb/ftp -in < ftp.in: not found
>>>
>>>How can I system this from perl?
>
>>What happens if you say:
>>
>>system("exec /bin/sh -c '/usr/ucb/ftp -in < ftp.in'");
>
>Nope, still hangs. Ultimately, it's still invoking:
>
>/bin/sh -c /usr/ucb/ftp -in < ftp.in
I finally got this to work by putting the entire command in a file,
and system'ing that.
So I have a file, ftp.cmd, that has one line:
/usr/ucb/ftp -in < ftp.in
And I say "system("ftp.cmd")" and works! Very kludgy - create 2 files,
make one executable, remove them when I'm done. Eccch! But it works. Go
figure.
larry
--
Larry Martell "When I do good, I feel good. When I do bad,
larrym@imsi.com I feel bad. And that is my religion."
------------------------------
Date: Wed, 1 Jul 1998 22:40:37 -0400
From: "Penn White" <pwhite@nospamsurfsouth.com>
Subject: Re: require $redir.'setup.pl'; ??
Message-Id: <359af354.0@news.surfsouth.com>
>: Can anyone explain this line to me? I found it in a perl program I am
>: trying to adapt for my application and it isn't anything I recognize or
have
>: been able to find in my books.
>
>It's usually a good idea to put your whole question in the body of your
>message; I stared at yours thinking "What line?" for a while before I
>noticed the subject, which I'll copy here for convenience:
>
> require $redir.'setup.pl'; ??
Sorry. I can see now how it might have been confusing.
>See 'perldoc -f require' if you don't know what that means. The rest is
>just building require's argument by string-concatenating a variable (a dir
>path, presumably) and a literal string.
>
>Does that help?
Very much. I see exactly what you mean. I was letting the 'period' after
$redir confuse me - forgot about concatention. I still can't find where the
author of the script is defining $redir, however. Does it have to be
defined
or is it some sort of reserved word in perl? Why doesn't he just say
require 'setup.pl';
The "require $redir.'whatever.pl';" statements are all in libraries. Does
that
help to explain it? In the main program, he uses the simple "require
'whatever.pl';
construct.
Sorry if these are stupid questions.
Penn White
------------------------------
Date: Wed, 01 Jul 1998 23:23:57 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Running Unix Script in Perl
Message-Id: <comdog-ya02408000R0107982323570001@news.panix.com>
Keywords: from just another new york perl hacker
In article <3599E988.3146@virgin.net>, steve.leach@virgin.net posted:
>Is it possible to run a unix script from within a perl script.
several options exist. perlfunc and perlipc will help you decide
between things such as
`` (backticks)
system()
exec()
among other things. or perhaps the perlfaq man page:
[snip]
the perlfaq8 manpage: System Interaction
Interprocess communication (IPC), control over the
user-interface (keyboard, screen and pointing devices).
[snip]
good luck :)
--
brian d foy <comdog@computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
most things are possible, mostly.
------------------------------
Date: 2 Jul 1998 02:23:26 GMT
From: dha@panix.com (David Adler)
Subject: Re: Testing perl knowledge
Message-Id: <6nequv$2o3@news1.panix.com>
On Wed, 24 Jun 1998 22:59:24 GMT, Charles DeRykus
<ced@bcstec.ca.boeing.com> wrote:
[In re: Chris' potential engineer violation hearing...]
>Judge: Dismissed... but don't be seen hanging out with
> Randal.
Hmm... I think you're in trouble, Chris... :-)
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Got Perl? <www.perl.com>
Got a Perl User Group? <www.pm.org>
------------------------------
Date: Thu, 02 Jul 1998 03:52:12 GMT
From: Nick Forte <webmaster@triologic.com>
To: Toby Chamberlain <tjchamberlain@hotmail.com>
Subject: Re: Uploading image files
Message-Id: <359B021E.E429DB23@triologic.com>
Having the same problem! See posts on File upload - Need Help.
Reason is the file is being written to the server as an owner who doesn't
have permission to write to the disk (in my case it is 'nobody'). Still
trying to find solution. Let me know if you get anything.
Toby Chamberlain wrote:
> Hi there...
>
> .. I'm trying to upload stuff through the web using a
> multipart/form-dataHTML form and a Perl CGI script. Everything works
> fine except when I try to upload images. The image in question is
> around 2k in size, and $ENV{CONTENT_LENGTH} is just over 2k, but the
> read() returns 0 bytes... I've tried dumping the read data out to the
> web and it looks like this :
>
> -----------------------------932131817039
> Content-Disposition: form-data; name="GIFFILE";
> filename="C:\HTML\CyberOne\KidsGame\pizza.gif"
> Content-Type: image/gif
>
> GIF89a
>
> And that's it..sometimes there's a line or two of #%#4jl3%^4j6l after
> the GIF89a before it stops. As you can see the contents of the .gif
> haven't been included properly and none of the other form elements
> (there are two after this) have come through either. I've tried
> explicitly binmoding both the input and output streams in case one of
> the .gif bytes was being read as EOF but that didn't work. As I said
> the code works fine for HTML and other text files. What have I
> forgotten to do???
>
> Thanks
> Toby <tjchamberlain@hotmail.com>
------------------------------
Date: 02 Jul 1998 10:44:24 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Vertical Perl
Message-Id: <r8ogv9awb3.fsf@asc.sps.mot.com>
RICHARD PROULX <richard.proulx@sun.com> writes:
> Questions:
> Is there a way to access string elements like
> $string[2] = "t" for aboce example
>
> Is there a such thing as character arrays like:
> $character_array = (80,24) where $character_array[0,0] gives you the top
> row, left column character of the array.
>
You can turn a string into an array using split:
@CharArray = split(//, $String);
Now you have an array of characters, with which you should be able to
do what you want...
# The input
my @Strings = ('frq_1', 'cnt_bob_5');
my $MaxLength = 0;
# Make a hash containing char arrays of each string
my %CharArrays;
my $string;
foreach $string (@Strings)
{
$CharArrays{$string} = [split(//, $string)];
# (why doesn't perl have 'min' & 'max' commands?!)
$MaxLength = (length($string) > $MaxLength) ? length($string) : $MaxLength;
}
# print out the vertical strings
my $line;
for $line (0 .. $MaxLength-1)
{
foreach $string (@Strings)
{
print defined($CharArrays{$string}[$line]) ?
$CharArrays{$string}[$line] : " ";
}
print "\n"
}
Darn! Now I've posted a solution instead of advice. Oh well - it was fun!
Martin.
------------------------------
Date: Thu, 02 Jul 1998 02:26:57 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: while (<CSV_FILE>) doesn't work with NT
Message-Id: <6ner9e$ktl$1@strato.ultra.net>
[ posted and mailed ]
insider@comet.connix.com (Stephen L. Vinson) wrote:
-> I'm new to Perl, but have successfully written a Perl 5 script that reads
-> a CSV file and queries its contents. The script works fine on a
-> Unix-based server, but fails to do the same thing on an NT-based server
-> (called "Site Stack" if this helps). Here's the pertinent code. Assume I
-> log in as IADM_STEVE, so my base directory is "/~steve":
->
-> $basedir = "/~steve";
-> $datafile = "phonelist.csv";
->
-> open(PHONE_LIST,"$basedir/$datafile");
->
-> ...code up this point works fine...
->
-> while (<PHONE_LIST>)
-> {
-> ...this code NEVER gets executed...
-> }
You should always check the results of your open. That is probably where your
problem lays.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: 2 Jul 1998 02:55:18 GMT
From: insider@comet.connix.com (Stephen L. Vinson)
Subject: Re: while (<CSV_FILE>) doesn't work with NT
Message-Id: <6nesqm$ckb@beast.connix.com>
I have just learned of the $! variable. It reports "No such file or
directory". Now I have to find out why...
Thanks for your help.
Steve
Bob Trieger (sowmaster@juicepigs.com) wrote:
: [ posted and mailed ]
: insider@comet.connix.com (Stephen L. Vinson) wrote:
: -> I'm new to Perl, but have successfully written a Perl 5 script that reads
: -> a CSV file and queries its contents. The script works fine on a
: -> Unix-based server, but fails to do the same thing on an NT-based server
: -> (called "Site Stack" if this helps). Here's the pertinent code. Assume I
: -> log in as IADM_STEVE, so my base directory is "/~steve":
: ->
: -> $basedir = "/~steve";
: -> $datafile = "phonelist.csv";
: ->
: -> open(PHONE_LIST,"$basedir/$datafile");
: ->
: -> ...code up this point works fine...
: ->
: -> while (<PHONE_LIST>)
: -> {
: -> ...this code NEVER gets executed...
: -> }
: You should always check the results of your open. That is probably where your
: problem lays.
: HTH
: Bob Trieger
: sowmaster@juicepigs.com
: " Cost a spammer some cash: Call 1-800-286-0591
: and let the jerk that answers know that his
: toll free number was sent as spam. "
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3043
**************************************