[9387] in Perl-Users-Digest
Perl-Users Digest, Issue: 2982 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 25 16:07:57 1998
Date: Thu, 25 Jun 98 13:00:33 -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 Thu, 25 Jun 1998 Volume: 8 Number: 2982
Today's topics:
Re: a bit confused about seek (Jeff Henry)
Re: Can Anyone help? <jdporter@min.net>
Re: Can someone explain the arrow operator ? (Larry Rosler)
Re: Can someone explain the arrow operator ? <jdporter@min.net>
Re: Can someone explain the arrow operator ? (Larry Rosler)
Re: Can someone explain the arrow operator ? (Larry Rosler)
Re: Can someone explain the arrow operator ? <jdf@pobox.com>
Re: Can someone explain the arrow operator ? (Sean McAfee)
Re: challenge: put search into an array (Patrick Timmins)
Re: challenge: put search into an array (Larry Rosler)
Re: challenge: put search into an array <jdporter@min.net>
Re: challenge: put search into an array (Patrick Timmins)
Date calculation formula needed <romeyde@mc0115.mcclellan.af.mil>
Re: Date Calculation Problems. (Jeff Henry)
efficient director watching psj@cgmlarson.com
Re: Embedding perl on Win32 with Watcom C?? <kjotph@midwest.net>
Re: first language - last language <jan.moren.removeme@fil.lu.se>
Re: help! : Arrays in Perl (Mark-Jason Dominus)
Re: Hiding the Perl source (Larry Rosler)
Re: Hiding the Perl source (Steve Linberg)
Re: How do I pass more than one array as a parameter in (Matt Knecht)
Re: how to read a binary file containing C structures (Steve van der Burg)
Installing Perl on Windows95- Problem with Install.bat <vcolf@ix.netcom.com>
One other nagging regexp problem <hminter@herc.com>
Re: One other nagging regexp problem (Larry Rosler)
Re: One other nagging regexp problem <hminter@herc.com>
Re: opening a file on other domain <spamsux-tex@habit.com>
Re: parsing MIME types <*@qz.to>
Re: Perl on Linux access database on NT 4? <pearse@mail.shebang.net>
PerlIS and IIS.40 Setup.. Please help! <brians@vexis.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Jun 1998 19:25:21 GMT
From: jdhenry.NOSPAM@ismi.net (Jeff Henry)
Subject: Re: a bit confused about seek
Message-Id: <35925127.8646375@news.ismi.net>
On 24 Jun 1998 15:47:09 GMT, abigail@fnx.com (Abigail) wrote:
> The Unix
>filesystem uses a flat "steam" model.
Must be a pretty old system if it runs on steam. But not as old as our
good ol' coal-fired IBM mainframe! :-)
Jeff Henry, Compuware Corp. | This sig under construction
standard opinions/employer disclamer | Some cute ASCII art here, or
"A witty quote" - by someone famous | maybe my name in big block
http://url.to.some.cool.site | letters.
------------------------------
Date: Thu, 25 Jun 1998 18:56:15 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Can Anyone help?
Message-Id: <35929EE7.2215@min.net>
Jason L Rudland wrote:
>
> I have a perl script which opens a DBM database and reads the
Are you using tie? You probably ought to be.
Especially since it makes what you want to do really easy.
use NDBM_File;
tie %dbm, 'NDBM_File', $my_dbm_file;
print $FieldName;
print $dbm{$FieldName};
% perldoc perltie
--
John Porter
------------------------------
Date: Thu, 25 Jun 1998 11:30:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <MPG.ffc3703550095829896d0@nntp.hpl.hp.com>
In article <Wbwk1.1207$24.6656383@news.itd.umich.edu>, Sean McAfee
<mcafee@centipede.rs.itd.umich.edu> says...
...
> Caveat ahoy! Compare:
>
> $_ = "abcdefg";
> @a = (uc , "foo");
> @b = (uc => "foo");
>
> @a is ("ABCDEFG", "foo"), whereas @b = ("uc", "foo"). => forces its
> left-hand argument to be interpreted as a string. In the @a assignment, uc
> was interpreted as a call to the uc function, which operated on $_, since I
> didn't give it a parameter.
And the '-w' flag would cause a warning about @b. You *were* using '-w',
weren't you? If not, why not???
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Jun 1998 18:46:04 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <35929C7B.57B5@min.net>
Mike Mckinney wrote:
>
> Could someone give me some help and examples on this?
Arrows are used to get at the things refered to by a reference.
Given $r = \@a;
then $r->[0] refers to the thing otherwise known as $a[0].
Similarly, give $r = \%h;
then $r->{'F'} refers the same thing as $h{'F'}.
This also works for anonymous arrays and hashes:
$r = [ 6, 7, 8 ];
print $r->[2]; # prints 8
$r = { name => 'rover', age => '5' };
print $r->{name}; # prints 'rover'
As of a recent version of Perl (5.004?) this syntax works for
sub refs as well:
sub foo { print "@_\n" }
$r = \&foo;
$r->( @a ); # call foo( @a )
$r = sub { print "@_\n" }; # an anonymous sub
$r->( @a );
There is another use of the arrow operator, which is, uh,
"tangentially" related to the usage described above.
It is for calling methods, if you're using object-oriented perl.
The thing before the arrow can be either a package name or an
object (reference) which has been blessed into a package.
In either case, the thing before the arrow is inserted as the
first argument in the argument list to the function call.
Thus,
package MyClass;
sub new {
my( $package, $arg ) = @_;
bless { };
}
sub foo {
my( $object, $arg ) = @_;
}
package main;
$obj = MyClass->new( 1 ); # call a "package method"
$obj->foo( 2 ); # call an "object method"
Hopefully this is enough to get you over the mental hurdle.
Good luck. Keep reading and experimenting.
(Note: I intentially oversimplified some things, of course!)
--
John Porter
------------------------------
Date: Thu, 25 Jun 1998 11:59:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <MPG.ffc3de2d7a2b53e9896d3@nntp.hpl.hp.com>
In article <Wbwk1.1207$24.6656383@news.itd.umich.edu>, Sean McAfee
<mcafee@centipede.rs.itd.umich.edu> says...
...
> Caveat ahoy! Compare:
>
> $_ = "abcdefg";
> @a = (uc , "foo");
> @b = (uc => "foo");
>
> @a is ("ABCDEFG", "foo"), whereas @b = ("uc", "foo"). => forces its
> left-hand argument to be interpreted as a string. In the @a assignment, uc
> was interpreted as a call to the uc function, which operated on $_, since I
> didn't give it a parameter.
And the '-w' flag would cause a warning about @b. You *were* using '-w',
weren't you? If not, why not???
I'll never forget my shock when writing a hash like a => 'foo', b =>
'bar', ... to get warnings on m, s and y. Ouch. But quotes or capital
letters solved the problem.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Jun 1998 12:08:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <MPG.ffc401d2b6a267a9896d5@nntp.hpl.hp.com>
In article <Wbwk1.1207$24.6656383@news.itd.umich.edu>, Sean McAfee
<mcafee@centipede.rs.itd.umich.edu> says...
...
> Caveat ahoy! Compare:
>
> $_ = "abcdefg";
> @a = (uc , "foo");
> @b = (uc => "foo");
>
> @a is ("ABCDEFG", "foo"), whereas @b = ("uc", "foo"). => forces its
> left-hand argument to be interpreted as a string. In the @a assignment, uc
> was interpreted as a call to the uc function, which operated on $_, since I
> didn't give it a parameter.
And the '-w' flag would cause a warning about @b. You *were* using '-w',
weren't you? If not, why not???
I'll never forget my shock when writing a hash like a => 'foo', b =>
'bar', ... to get warnings on m, s and y. Ouch. But quotes or capital
letters solved the problem.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 25 Jun 1998 15:42:42 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: mcafee@centipede.rs.itd.umich.edu (Sean McAfee)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <btrh9prx.fsf@mailhost.panix.com>
mcafee@centipede.rs.itd.umich.edu (Sean McAfee) writes:
> Caveat ahoy! Compare:
>
> $_ = "abcdefg";
> @a = (uc , "foo");
> @b = (uc => "foo");
>
> @a is ("ABCDEFG", "foo"), whereas @b = ("uc", "foo").
Yes indeed. Emacs Cperl-mode knows this, and colors that "uc" like a
string constant as as soon as you type the =>. Very neat.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Thu, 25 Jun 1998 19:51:37 GMT
From: mcafee@centipede.rs.itd.umich.edu (Sean McAfee)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <dTxk1.1215$24.6735814@news.itd.umich.edu>
In article <MPG.ffc3703550095829896d0@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <Wbwk1.1207$24.6656383@news.itd.umich.edu>, Sean McAfee
><mcafee@centipede.rs.itd.umich.edu> says...
>> Caveat ahoy! Compare:
>> $_ = "abcdefg";
>> @a = (uc , "foo");
>> @b = (uc => "foo");
>> @a is ("ABCDEFG", "foo"), whereas @b = ("uc", "foo"). => forces its
>> left-hand argument to be interpreted as a string. In the @a assignment, uc
>> was interpreted as a call to the uc function, which operated on $_, since I
>> didn't give it a parameter.
>And the '-w' flag would cause a warning about @b. You *were* using '-w',
>weren't you?
No.
>If not, why not???
The point of the article was to describe the difference between , and =>.
Adjusting the program to appease -w would have made them behave
identically.
Anyway, I don't care to use -w in general.
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Thu, 25 Jun 1998 17:45:51 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: challenge: put search into an array
Message-Id: <6mu2cg$m51$1@nnrp1.dejanews.com>
In article <6mto3p$6fa$1@nnrp1.dejanews.com>,
spostma@my-dejanews.com wrote:
>
> I am an experienced programmer and I'm trying to search a string for "name="
> using this code.
>
> $temp =~ s/.*name=(.*)/$1/;
>
> It works just fine. But when I have more than one occurrence of the "name=",
> I need to put the results into an array. I have tried creating a loop that
> puts $1 into an array, but it won't return any values.
>
> Any thoughts??
>
[snip]
How about:
@myarray = split(/\s*name=/, $temp);
This should work assuming all of your "name=xxx" pairs are separated by white
space.
Hope that helps.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 25 Jun 1998 11:12:47 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: challenge: put search into an array
Message-Id: <MPG.ffc32fb1ef80e0b9896ce@nntp.hpl.hp.com>
In article <6mu2cg$m51$1@nnrp1.dejanews.com>, Patrick Timmins
<ptimmins@netserv.unmc.edu> says...
> In article <6mto3p$6fa$1@nnrp1.dejanews.com>,
> spostma@my-dejanews.com wrote:
> >
> > I am an experienced programmer and I'm trying to search a string for "name="
> > using this code.
> >
> > $temp =~ s/.*name=(.*)/$1/;
...
> How about:
>
> @myarray = split(/\s*name=/, $temp);
>
> This should work assuming all of your "name=xxx" pairs are separated by white
> space.
White space has nothing to do with it. In your code, the *separator* is
the string 'name=' (leaving off the extraneous \s*). Which leaves the
value of $array[0] as any stuff ahead of the first 'name=', which should
be discarded. So:
@myarray = split /name=/, $temp;
shift @myarray;
seems like the simplest approach. This could be written as a one-liner
with an array slice, but it's sort of ugly and why bother?
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Jun 1998 18:12:22 GMT
From: John Porter <jdporter@min.net>
Subject: Re: challenge: put search into an array
Message-Id: <3592949C.15B4@min.net>
spostma@my-dejanews.com wrote:
>
> I am an experienced programmer and I'm trying to search a string for "name="
> using this code.
Search?
Or replace???
> $temp =~ s/.*name=(.*)/$1/;
>
> It works just fine.
> But when I have more than one occurrence of the "name=",
Are you saying that name= might occur more than once in $temp? e.g.
$temp = "name=bud name=sal name=harv" ?
Because if so, that line up there won't work. It sets $1, and thus
$temp,
to "bud name=sal name=harv". Not what you want. You need to be
more precise about what chars can follow a 'name='. If, for example,
any non-space characters can constitute a "name", then:
$temp =~ s/name=(\S*)/$1/;
But this still only finds one occurence.
> I need to put the results into an array.
What results?
s/// returns the number of times it made a replacement.
Do you mean an array of all the names it found?
If you really want to do a substitution *and* get a list of
the names found, you can use an eval like this:
my @names = ();
$temp =~ s/name=(\S*)/push(@names,$1);$1/ge;
Of course, there are other ways to do it.
Probably the most important point is to use the /g modifier,
so that your regex (whether m// or s///) is applied as often
as necessary, rather than just once.
> I have tried creating a loop that
> puts $1 into an array, but it won't return any values.
You have? What's the code look like?
If we could see it, maybe we could point out where you're going astray.
--
John Porter
------------------------------
Date: Thu, 25 Jun 1998 18:14:46 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: challenge: put search into an array
Message-Id: <6mu42l$npp$1@nnrp1.dejanews.com>
In article <6mto3p$6fa$1@nnrp1.dejanews.com>,
spostma@my-dejanews.com wrote:
>
> I am an experienced programmer and I'm trying to search a string for "name="
> using this code.
>
> $temp =~ s/.*name=(.*)/$1/;
>
> It works just fine. But when I have more than one occurrence of the "name=",
> I need to put the results into an array. I have tried creating a loop that
> puts $1 into an array, but it won't return any values.
>
> Any thoughts??
>
[snip]
A clarification on my earlier post: I'm assuming that $temp looks something
like this:
$temp = "name=larry";
or
$temp = "name=larry name=tom name=randal";
I am not using the regex substitution shown in the poster's code ... this
won't work. If $temp is in the form I've shown above, then:
@myarray = split(/\s*name=/, $temp);
and you'll also have to throw out the first "phantom" null match of the split
operator that I gave you (sorry) so:
shift @myarray;
Hope that's clear.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 25 Jun 1998 17:00:26 +0000
From: Derek Romeyn <romeyde@mc0115.mcclellan.af.mil>
Subject: Date calculation formula needed
Message-Id: <3592822A.B806DC0D@mc0115.mcclellan.af.mil>
I have this set of data which I am extracting dates from. The dates are
in a annoying format like so: 8013
That stands for the 13th day of 1998. So the largest number would be
8365 and then it would roll to 9001.
What I need to be able to do is calculate if the extracted date is
within a certain range. IE: 30,90,180 days of the current date.
The only methods I can think of involve some pretty simple but time
consuming processes. IE: convert every date back to readable format
(1998, 01, 13) then use date_difference (part of Date::Datecalc) to get
the result. But seems pretty durn inefficient and I will be dealing
with a 500k+ file.
Any pointers would be highly appreciated. Did searches on Dejanews but
had trouble figuring how to do the query. Julian and rayday with perl
came up with nil.
--
Derek W Romeyn romeyde@calweb.com
I wish I could say everything there was to say in one word. I hate
all the things that can happen between the beginning of a sentence
and the end. -- Leonard Cohen, The Favourite Game
------------------------------
Date: Thu, 25 Jun 1998 19:25:21 GMT
From: jdhenry.NOSPAM@ismi.net (Jeff Henry)
Subject: Re: Date Calculation Problems.
Message-Id: <359283e5.21634831@news.ismi.net>
On Wed, 24 Jun 1998 23:51:01 GMT, Gellyfish@btinternet.com (Jonathan
Stowe) wrote:
>> DateCalc
>>returns the result into a variable $date which contains
>>
>>1998122112:39:01
>>
>That looks suspiciously like it returned a list of the form:
>
>($year,$month,$date,$time)
>
>but of course thats just me and I dont have the Date::Manip docs to
>hand.
No it's a scalar, not a list. The Date::Manip docs talk about an
alternative format, that eliminates the :'s, so that you'd get:
19981221123901
You could still break this up with a substr/split/regex, but it might
be safer to use the routines supplied with Date::Manip. That way, you
won't have to worry about which internal format you have ,or about the
format changing in a future version.
my $year=&UnixDate($date, "%Y");
my $month=&UnixDate($date, "%m");
my $day=&UnixDate($date, "%d");
or, get all of them at once:
my ($year, $month, $day) = &UnixDate($date, "%Y", "%m", "%d");
or, how about in a nice formated string;
my $nicedate = &UnixDate($date, "%m/%d/%Y");
Hope this helps!
--
Jeff Henry, Compuware Corp. | This sig under construction
standard opinions/employer disclamer | Some cute ASCII art here, or
"A witty quote" - by someone famous | maybe my name in big block
http://url.to.some.cool.site | letters.
------------------------------
Date: 25 Jun 1998 19:53:00 GMT
From: psj@cgmlarson.com
Subject: efficient director watching
Message-Id: <6mu9qs$2jo$1@news4.ispnews.com>
Howdy everyone!
I was just wondering if anyone knows of an elegant and efficient way
to keep an eye on a directory for changes. I'd like to have a program
that is inactive (mostly) unless the contents of the directory change.
Is File::stat combined with a while/sleep loop going to be the best?
Thanks in advance!
Pat
--
Patrick St. Jean '97 XLH 883 psj@cgmlarson.com
Programmer & Systems Administrator +1 713-977-4177 x115
Larson Software Technology http://www.cgmlarson.com
------------------------------
Date: Thu, 25 Jun 1998 12:33:53 -0500
From: "Tim Hart" <kjotph@midwest.net>
Subject: Re: Embedding perl on Win32 with Watcom C??
Message-Id: <6mu1ga$fo8@enews4.newsguy.com>
Supposed, using the standard win32 port, you are able to use perl with
Borland C++ 5.02 (only) and MSVC++ 2+. I think a full defined reasoning
behind this is available in the documentation *.readme (not sure exactly
about the filename). Yet, Watcom is not one of them listed.
Coder^
Craig Setera wrote in message <3592819A.297E77B4@us.ibm.com>...
>I have the precompiled version of Perl built by Borland C++. Is it
>possible for me to embed
>Perl in my C program and compile it with Watcom C/C++? Has anyone tried
>this and gotten
>it to work?
>
>Craig
>
------------------------------
Date: 25 Jun 1998 19:09:29 GMT
From: Jan Moren <jan.moren.removeme@fil.lu.se>
Subject: Re: first language - last language
Message-Id: <6mu799$k8v$1@news.lth.se>
birgitt@my-dejanews.com wrote:
> In article <3588E674.50B81564@nortel.co.uk>,
> What is the *last* language all you experts would ever want to
> deal with ? Don't say there isn't one.
Intercal. Unlike other languages, it was constructed explicitly to be as
difficult and obtruse as possible. Apparently the compiler is available for
several platforms, together with all source written in it. Look it up in the
Hacker's dictionary for more info.
--
MvH Janne Mr. Janne More4n
(jan.moren@fil.lu.se) Kognitionsforskning
046-222 9758 Kungshuset, Lundagerd
046-211 4973 S-222 22 Lund, Sweden
------------------------------
Date: 25 Jun 1998 15:28:37 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: help! : Arrays in Perl
Message-Id: <6mu8d5$mfu$1@monet.op.net>
Keywords: apache argillaceous Arianism communion
In article <35924387.A260745F@jmu.edu>,
Justin Voshell <vosheljh@jmu.edu> wrote:
> I am pretty new with Perl an can't seem to find a function that will
>tell me the length of an array. Is there such a thing [there must be]?
There isn't. If you use an array in a place where a length would make
sense, Perl uses the length instead. For example:
$length = @array; # Assign array's length to $length
if (@array > 4) { ... } # If more than four elements...
while (@array) { ... } # Repeat while array is nonempty
$array[@array] = 3; # Append new element to the end of the array
# (push @array, 3) may be more efficient
$last_element = $array[@array-1]; # Get last element in array
# ($array[-1]) works also
------------------------------
Date: Thu, 25 Jun 1998 11:53:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Hiding the Perl source
Message-Id: <MPG.ffc3c67baf10b899896d2@nntp.hpl.hp.com>
In article <6mu2mu$6m2$3@client3.news.psi.net>, Abigail <abigail@fnx.com>
says...
...
> I really dislike the attitude of "what I need to develop stuff should
> be free, but what I develop should not". It's anti-social.
I fear another flame war about to begin.
Your statement is very offensive, and more fitting for Stallman to use
(as he repeatedly does).
The Perl code I write has economic value to my company, and they pay me
to produce it. If I use a 'free' tool, that is irrelevant to the value
of the work product. (In fact, for Windows I use a perl port for which
my company pays MKS as part of their Toolkit, but that really doesn't
change the issue -- I use free perl on Unix.)
This use for commercial purposes is explicitly permitted by the
License(s), which my company would not violate. It is *not* anti-social
for me not to share my code freely -- it is anti-having-a-job.
That doesn't prevent me from sharing my ideas here, presumably on my own
time.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Jun 1998 15:11:16 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Hiding the Perl source
Message-Id: <linberg-2506981511160001@projdirc.literacy.upenn.edu>
In article <MPG.ffc3c67baf10b899896d2@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:
> In article <6mu2mu$6m2$3@client3.news.psi.net>, Abigail <abigail@fnx.com>
> says...
> ...
> > I really dislike the attitude of "what I need to develop stuff should
> > be free, but what I develop should not". It's anti-social.
>
[snip]
> Your statement is very offensive, and more fitting for Stallman to use
> (as he repeatedly does).
[snip]
> That doesn't prevent me from sharing my ideas here, presumably on my own
> time.
Nobody said you couldn't, and Abigail was only stating her feelings on the
subject, not claiming a universal truth. She didn't say you should give
your stuff away or change the way you do things.
Please, we've got enough flame wars going here right now. Let's all take
a breath.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Thu, 25 Jun 1998 18:05:18 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: How do I pass more than one array as a parameter into a subroutine?
Message-Id: <yjwk1.49$u05.534759@news3.voicenet.com>
Bryan T Hoch <bth@cs.buffalo.edu> wrote:
>it. I looked at the FAQ and I didn't see it there (so I hope I didn't just
>miss it and am wasting bandwidth).
You did, and you are. :)
>What I want to do is pass two different arrays into a subroutine and then
>get them out on the other side as the seperate arrays still.
perldoc perlfaq7
Specifically: How can I pass/return a {Function, FileHandle, Array,
Hash, Method, Regexp}?
--
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"
------------------------------
Date: Thu, 25 Jun 1998 18:55:12 GMT
From: steve.vanderburg@lhsc.on.ca (Steve van der Burg)
Subject: Re: how to read a binary file containing C structures
Message-Id: <6mu6d1$na4@falcon.ccs.uwo.ca>
In article <35947b99.531836089@news.mmc.org>, drummj@mail.mmc.org wrote:
>>Aravind Nallan wrote:
>>> I have a binary file produced by a C program which contains C structures
>>> written using fwrite. Do we have any way of reading them in perl and
>>> writing out into Ascii?
I've done the same thing to whip up an HTMLized output of a little set of
statistics stored in a small file created and updated by a compiled C program.
The file is represented by a C structure that contains 17 unsigned long
integers, so the Perl code is simple:
sysopen ISTATFILE,$statfilename,0; # open the file
sysread ISTATFILE,$packedstats,68; # read 68 bytes (17 longs)
@blah = unpack('L17',$packedstats); # unpack into a Perl array
close ISTATFILE;
print "stat 1 is $blah[0]";
# etc...
..Steve
--
Steve van der Burg
Technical Analyst, Information Services
London Health Sciences Centre
London, Ontario, Canada
Tel: +1 519 663-3300 x 5559 (work)
+1 519 472-6686 (home)
Email: steve.vanderburg@lhsc.on.ca
WWW: http://www.lhsc.on.ca/~vanderbg/
------------------------------
Date: Thu, 25 Jun 1998 11:52:55 -0700
From: Vicky <vcolf@ix.netcom.com>
Subject: Installing Perl on Windows95- Problem with Install.bat
Message-Id: <35929C86.5ADBEB62@ix.netcom.com>
I'm using Active States port of Perl for Windows 95 and NT and after I
run Winzip and then run the install.bat file I get an error message
(from install.bat) saying that it cannot find the file Y:command.com or
that that file is in use.
Anybody have an idea what the problem is here...why is it looking for a
Y drive?
Thanks!
Vicky
please email me
vcolf@ix.netcom.com
------------------------------
Date: Thu, 25 Jun 1998 18:05:33 GMT
From: "H. Wade Minter" <hminter@herc.com>
Subject: One other nagging regexp problem
Message-Id: <359290F0.A0D4C28A@herc.com>
Got the first regexp problem working! Woo hoo! Thanks!
There's one other that I haven't been able to get to work:
In the email parsing, I want to insert a /Status: RO/ line if the
message doesn't already have one. This is the regexp I'm working with
now:
if (no status line currently in header)
{
$message =~ s/Subject: /Status: RO\nSubject: /;
}
$message =~ s/Subject: /Status: RO\nSubject: /s; # didn't work either.
My thinking being "Stick 'Status: RO' in front of the subject line, if
the Status line doesn't already exist. But it doesn't seem to work. No
changes to the headers are made.
Thoughts?
Thanks,
Wade
------------------------------
Date: Thu, 25 Jun 1998 11:18:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: One other nagging regexp problem
Message-Id: <MPG.ffc34708d3169b29896cf@nntp.hpl.hp.com>
In article <359290F0.A0D4C28A@herc.com>, H. Wade Minter
<hminter@herc.com> says...
...
> if (no status line currently in header)
> {
> $message =~ s/Subject: /Status: RO\nSubject: /;
> }
>
> $message =~ s/Subject: /Status: RO\nSubject: /s; # didn't work either.
The 's' is irrelevant here, as you have found.
> My thinking being "Stick 'Status: RO' in front of the subject line, if
> the Status line doesn't already exist. But it doesn't seem to work. No
> changes to the headers are made.
Nothing obviously wrong. Have you printed $message *immediately* before
the regex match to make sure that you are reaching that statement and
that the string 'Subject: ' is really there?
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Jun 1998 19:06:31 GMT
From: "H. Wade Minter" <hminter@herc.com>
Subject: Re: One other nagging regexp problem
Message-Id: <35929F39.6EB6DDB9@herc.com>
Larry Rosler wrote:
> Nothing obviously wrong. Have you printed $message *immediately* before
> the regex match to make sure that you are reaching that statement and
> that the string 'Subject: ' is really there?
"Doh"
On my test case message from my mbox, I'd deleted the "Status:" line, but had
left in an "X-Status" line. Guess what my "If it has a status line, do this,
else do that" conditional was matching on. Yup.../Status/. So it wasn't
making it into the "add" part of the test.
Doh! :-)
Thanks for the pointers!
--Wade
------------------------------
Date: Thu, 25 Jun 1998 10:38:23 +0800
From: Austin Schutz <spamsux-tex@habit.com>
Subject: Re: opening a file on other domain
Message-Id: <3591B81F.3E80@habit.com>
Negev wrote:
>
> How can i open file for reading on other domain??
> I can only open files on my own server, and i even need the real path
> (not the domain path) to open it.
>
how about lynx -source http://im.gonna.die.if/i/cant/get/this.html
If you have lynx on your box. This is the quick and dirty method.
Otherwise, look it up in a faq, such as
http://language.perl.com/faq/index.html, or on some machines,
try perldoc perlfaq.
Tex
> I know i can do it cause lots of sites (web site garage, gifwizard, and
> ofcourse, all search engine spiders) have done it.
> Please this is URGENT!!!
>
> Best Regards
> Negev
------------------------------
Date: 25 Jun 1998 19:03:01 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: parsing MIME types
Message-Id: <eli$9806251456@qz.little-neck.ny.us>
In comp.lang.perl.misc, Philipp <philipp999@corpex.com> wrote:
> I'm just about to write a small email client in perl. Does anybody
> know of a good way to parse MIME types?
Yes. If you don't know this already, then you have vastly underestimated
the amount of work involved in writing a "small email client."
> Any help much appreciated.
Mail ane the MIME extensions are well documented in the RFCs. Find
those and study them. The full ramifications of RFC822 and RFC1341
should keep you busy for several months. After that you can read
the lessor ones.
Elijah
------
then you can examine how specs differ from practice
------------------------------
Date: Thu, 25 Jun 1998 18:44:03 +0000
From: Robert Eric Pearse <pearse@mail.shebang.net>
To: Kay Molkenthin <molkiheg@sp.zrz.tu-berlin.de>
Subject: Re: Perl on Linux access database on NT 4?
Message-Id: <35929A73.4BB2EB34@mail.shebang.net>
Kay,
Did you figure it out?
I've got an Access 2.0 database sitting on a NetWare 4.11 server that
I access via ncpfs. I would like to get info out of the Access database.
Where you able access the NT database from a Linux box?
Cheers,
Robert
Kay Molkenthin wrote:
> Hi,
>
> I just finished my diploma application on NT 4. It uses a GUPTA
> SQL-Server. For some upcoming apps to my program I would like to build
> them on Linux with perl because except this diploma app I only work on
> Linux myself.
>
> Is it possible to access this GUPTA-Server and its databases from a
> Linux computer over LAN with perl. I need that to generate some
> HTML-pages/forms which include informations from that Gupta-databases.
>
> Kay.
> --
> Kay Molkenthin - Ruesternallee 45 - 14050 Berlin [GERMANY]
> Email: molkiheg@sp.zrz.tu-berlin.de / Kay_Molkenthin@Bigfoot.de
> ------------------------------------------------------------------
> Key fingerprint = A6 1E 73 E7 E7 77 75 E1 7C E6 EF AF 78 A6 6C 38
--
______________________________________________________
Robert Eric Pearse pearse@mail.shebang.net
Internet Developer http://www.shebang.net
------------------------------
Date: Thu, 25 Jun 1998 09:20:53 -0500
From: "Brian Smith" <brians@vexis.com>
Subject: PerlIS and IIS.40 Setup.. Please help!
Message-Id: <35925db1.0@206.103.97.91>
This question has already been posted by another, but the response (if any)
was sent directly to his email. Please forgive me for asking it again...
I am just beginning to break into the world of Perl. I have an NT server
with IIS 4.0, and have downloaded the Perl32 and PerlIS stuff from
Activeware, installing it to what I believe is the proper specs. The
registry (and app extentions in IIS) reflect .pl as being associated with
c:\perl\bin\perlis.dll. (Note, I have also tried perl.exe %s %s, and lots
of other things) Here is my error message:
'D:\InetPub\wwwroot\TrustMarkWeb\helloworld.pl' script produced no output
Here's my report log:
*** 'D:\InetPub\wwwroot\TrustMarkWeb\helloworld.pl' error message at:
1998/06/25 08:46:48
syntax error at D:\InetPub\wwwroot\TrustMarkWeb\helloworld.pl line 8, near
"print"
Execution of D:\InetPub\wwwroot\TrustMarkWeb\helloworld.pl aborted due to
compilation errors.
I would imagine that the fix is something silly that I haven't configured,
but I promise that I have been working on this for a while now, consulting
FAQ's, Microsoft's Tech Site, Perl web pages, etc. I have done my homework
on this and honestly can't find the answer. If someone would please guide
me in the right direction, I would greatly appreciate it.
Thanks!
Brian
brians@vexis.com
------------------------------
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 2982
**************************************