[11061] in Perl-Users-Digest
Perl-Users Digest, Issue: 4661 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 15 16:03:47 1999
Date: Fri, 15 Jan 99 13:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 15 Jan 1999 Volume: 8 Number: 4661
Today's topics:
[ANNOUNCE] new module Puppet::Show <domi@barrayar.grenoble.hp.com>
[ANNOUNCE] New module Tk::TreeGraph <domi@barrayar.grenoble.hp.com>
Re: A newbie who needs some help <newsposter@cthulhu.demon.nl>
ANNOUNCE: DbFramework-1.06 <paul@miraclefish.com>
ANNOUNCE: New perl module HTML::Clean <paul.lindner@ties.itu.int>
Can I pass # char thru script? (Byrd Harrison)
Chicago Perl Mongers (Jim Allenspach)
Re: CONCLUSIVE PROOF: This thread is spreading like ca <spam@nospam.spam.thankyamam>
Re: does globbing remember? <newsposter@cthulhu.demon.nl>
Re: glob error (M.J.T. Guy)
Re: glob error (Jan Schipmolder)
How to build perl as a dll on NT <cdivi@eagledev.com>
Re: HTML Form --> PERL "print" ?? (help!) <dstern@aschwebhosting.comnospam>
LWP::UserAgent: Basic Authorisation Bug (Michael Schilli)
more efficient error handling (Christian M. Aranda)
Re: open path problems <newsposter@cthulhu.demon.nl>
Re: Perl Criticism (Craig Berry)
Re: Problem with legacy Perl script (M.J.T. Guy)
Re: Problem with legacy Perl script <cdkaiser@delete.these.four.words.concentric.net>
Re: Problem with legacy Perl script (Larry Rosler)
Re: Problem with legacy Perl script <rick.delaney@home.com>
Re: reading and returning data from a file <newsposter@cthulhu.demon.nl>
Re: Regex challenge (Bart Lateur)
Re: Running Perl scripts for Macs <newsposter@cthulhu.demon.nl>
Re: Set current position in a file (Abigail)
Re: Small script required. (Abigail)
Re: tricky question.. possible??? mike@mjm.co.uk
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Jan 1999 20:06:45 GMT
From: Dominique Dumont <domi@barrayar.grenoble.hp.com>
Subject: [ANNOUNCE] new module Puppet::Show
Message-Id: <77o74l$mm2$1@play.inetarena.com>
Hello
Puppet::Show is a utility class that is used (and not inherited like
the deprecated Puppet::Any) to manage a L<Puppet::Body> class through
an optional GUI.
So when you construct a Puppet::Show object, you have all the
functionnality of this object without the GUI. Then, when the need
arises, you may (or the user class may decide to) open the GUI of
Puppet::Show so the user may perform any interactive action.
On the other hand, if the need does not arise, you may instanciate a lot of
objects (which uses Puppet::Show) without cluttering your display.
Suggested DSLI entry in the Tk Module list (section Module using Tk):
Puppet::Show adpO Optional Tk Gui for Puppet::Body DDUMONT
The user class may use the Puppet::Show Tk widget (actually a
Tk::Multi::Toplevel widget) and add its own widget to customize the
GUI to its needs.
This class features :
- A Tk::Multi::Toplevel to show or hide the different display of the
Show class (or of the user class)
- A menu bar
- An online help
- An event log display so user object may log their activity
- A Debug log display so user objects may log their "accidental"
activities
- An Object Scanner display the attributes of the user object
- A set of functions to manage "has-a" relationship between Puppet
objects.The menu bar feature a "content" bar which enabled the user
to open the display of all "contained" objects.
- a facility to store data on a database file tied to a hash.
I'd like people who use this module for their application to drop me a
short note about what they're using this module for.
Cheers
--
Dominique_Dumont@grenoble.hp.com
------------------------------
Date: 15 Jan 1999 20:04:36 GMT
From: Dominique Dumont <domi@barrayar.grenoble.hp.com>
Subject: [ANNOUNCE] New module Tk::TreeGraph
Message-Id: <77o70k$mir$1@play.inetarena.com>
Hello
Tk::TreeGraph is a Canvas specialized to draw trees on a Canvas using
arrows and nodes. A node is simply some text imbedded in a rectangular shape.
TreeGraph is able to draw the following items:
- node: some text in a rectangular shape.
- direct arrow: an arrow to go from one node to the following one.
- slanted arrow: an arrow to make a new branch
- shortcuts arrow: an arrow to represent a shortcut between 2 nodes from
different branches.
Suggested DSLI line in the Ptk module list:
Tk::TreeGraph bdpO Widget to draw a tree in a Canvas DDUMONT
See the embedded documentation in the module for more details.
Comments and suggestions are always welcome.
Cheers
--
Dominique_Dumont@grenoble.hp.com
------------------------------
Date: Fri, 15 Jan 1999 10:32:12 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: A newbie who needs some help
Message-Id: <369F5F7A.2F7A7460@cthulhu.demon.nl>
Danny Downs wrote:
>
> I am writing a perl script that would ask you to enter a username and
> password then telnet to a mail server and take the value of the username and
> the password and enter them once you connect to the mail server.
> For example you would enter the username "bob" and the password "bob1". once
> a connection to the mail server is made the script would initatate the
> 'user' command and the 'pass' command using the value that you entered
> above. What my problem is is that I can't get the 'user' and the 'pass'
> command to type out once I connect to the mail server. Can anyone help me
General response to 'newbie who needs help':
- Check dejanews for other articles in this newsgroup on this subject,
there have been quite a few.
- use the -w and strict
- check all open, check all things that can possibly go wrong and handle
those cases.
- read the relevant documentation. If you don't know what is relevent,
consider everything relevant ;)
- If that still doesn't help, post a _short_ fragment that exhibits the
problem.
Specific help:
- Assuming you're not using the Net::Telnet module: start using it
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: 15 Jan 1999 20:05:36 GMT
From: Paul Sharpe <paul@miraclefish.com>
Subject: ANNOUNCE: DbFramework-1.06
Message-Id: <77o72g$mlr$1@play.inetarena.com>
file: $CPAN/authors/id/P/PS/PSHARPE/DbFramework-1.06.tar.gz
size: 24187 bytes
md5: b8ab07a6b19e3deb007cca8218694ffc
DbFramework is a collection of classes for manipulating Mysql
databases. The classes are loosely based on the CDIF Data Model
Subject Area.
This module will help you to
- Present data model objects (tables, columns) as HTML
- Add persistency to your Perl objects
- Manipulate your Mysql databases through an HTML forms interface
See the POD for further details.
Prerequisites
=============
Alias
CGI
DBI
Msql-Mysql-modules
ePerl (for dbforms.cgi)
RELEASE 1.06
= UI
Default input templates now produce 'datasheet' view.
= API
Attribute::
- New method as_html_heading()
Key::
- New method as_html_heading()
PrimaryKey::
- New method as_html_heading()
Table::
- New method as_html_heading()
------------------------------
Date: 15 Jan 1999 20:04:22 GMT
From: Paul Lindner <paul.lindner@ties.itu.int>
Subject: ANNOUNCE: New perl module HTML::Clean
Message-Id: <77o706$miq$1@play.inetarena.com>
A new perl module, HTML::Clean, is now available. See below for
details.
1. INTRODUCTION
The majority of the web pages of the internet today are
much larger than they need to be. The reason for this is
that HTML tends to be stored in a human readable format, with
indenting, newlines and comments.
However, all of these comments, whitespace etc. are ignored by
the browser, and needlessly lengthen download times.
Second, many people are using WYSIWYG HTML editors these days.
This makes creating content easy. However these editors can
cause a number of compatibility problems by tying themselves to
a particular browser or operating system.
Enter HTML::Clean.
The HTML::Clean module encapsulates a number of HTML optimizations
and cleanups. The end result is HTML that loads faster, displays
properly in more browsers. Think of it as a compiler that
translates HTML input into optimized machine readable code.
Uses
You can use the library in your perl-cgi scripts to optimize data. Or
use the included htmlclean script to preprocess HTML files or templates
on your server.
The results should be pages that load faster, less load on your web
server and better cross-platform HTML.
To read about the latest features, see the Changes file. To find
out about known bugs and to see what's planned for future versions,
see the TODO file.
2. AVAILABILITY
You can get the latest version of the FrontPage module from the Comprehensive
Perl Archive Network (CPAN) or from the author's homepage:
http://www.perl.org/CPAN/modules/by-module/HTML/
http://people.itu.int/~lindner/
3. PREREQUISITES
The HTML module requires the following:
Perl 5.004
The HTML::Clean module may work with earlier versions of the above, but the
author hasn't tested this. The latest versions can be obtained from CPAN:
http://www.perl.org/CPAN/
4. INSTALLATION
To build this module, run the following commands:
perl Makefile.PL
make
make test
make install
5. COPYRIGHT
Copyright (c) 1999 ITU. All rights reserved. This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
6. AUTHOR INFORMATION
Paul Lindner
paul.lindner@itu.int
http://people.itu.int/~lindner/
--
Paul Lindner
International Telecommunication Union paul.lindner@itu.int
Tel: +41 22 730-5587 Fax: +41 22 730 5337
------------------------------
Date: Fri, 15 Jan 1999 18:57:56 GMT
From: byrd@gnc.net (Byrd Harrison)
Subject: Can I pass # char thru script?
Message-Id: <UcMn2.1809$Gk4.653088@news2.randori.com>
I have setup a script for password protection of a page at my site.
all works well except links with # character. ie /file.htm#toc
The script parses a .db file to access protected pages listed there.
I have tried to use the ASCII hex equivalent as in:
/file.htm%23toc
No luck
What would yall recomend?
Byrd
Byrd's Boats - http://dune.globe-net.net/~byrd/
------------------------------
Date: 15 Jan 1999 14:24:05 -0600
From: jima@MCS.COM (Jim Allenspach)
Subject: Chicago Perl Mongers
Message-Id: <77o855$fpm@Venus.mcs.net>
Keywords: chicago,pm
The Chicago PM chapter will be having its next meeting on Monday,
January 25th, at the offices of AIS (161 N Clark, #1350), starting at
7:30 PM. Information on the group or on how to get to the meeting can be
found at the group's Website, http://chicago.pm.org/ .
jma
------------------------------
Date: Fri, 15 Jan 1999 11:13:57 -0600
From: "Spam" <spam@nospam.spam.thankyamam>
Subject: Re: CONCLUSIVE PROOF: This thread is spreading like cancer (was: John is dead)
Message-Id: <77o743$6kh$1@news.ptialaska.net>
See all the crossposts? What the hell does comp.sys.ibm.pc.hardware.chips
have anything to do with the origional post that started this thread?
Motorcycles? Nintendo?
It's enough to to make some poor mailman go on a killing spree. Well,
anything can make a poor mailman go on a killing spree...
------------------------------
Date: Fri, 15 Jan 1999 10:42:10 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: does globbing remember?
Message-Id: <369F61D0.2CAEE813@cthulhu.demon.nl>
Trent wrote:
>
> globbing-
>
> I can open a series of text files and place the contents
> into an array, but is it possible to recover/identify what
> lines came from which original file? I'm thinking a hash,
> but then again I'm fairly new at this.
Put the file names you want to process in an array, eg @files.
Then you can process the files one at a time, and keep track
of what data came from which file.
foreach $file (@files) {
// read the file's data into $data
$file_data{$file} = $data;
}
You might want to use a somewhat more sophisticated data structure,
have a look at the perlref, perldsc and perllol documentation.
In my native language lol translates to fun ;)
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: 15 Jan 1999 18:45:38 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: glob error
Message-Id: <77o2ci$opv$1@pegasus.csx.cam.ac.uk>
In article <369F2BC0.20F1FC4E@giving.it.out>,
Etienne Pollard <not@giving.it.out> wrote:
>I have the following code:
>
>!#/usr/bin/perl -w
>
>@another = </home/webroot*>;
>foreach (@another) {
> print "$_\n";
>}
>
>When I run it I get the following error:
>
>Can't modify not in scalar assignment at glob.pl line 3, near
>"</home/webroot*>;"
>Execution of glob.pl aborted due to compilation errors.
>
>I'm running Red Hat Linux 5.02, Perl 5.004.
I suspect you aren't running Perl 5.004, but a later version.
Try running "perl -V" - I suspect you'll find the output contains
the line
MAINT_TRIAL_4 - 5.004_05 maintenance trial 4
^^^^^ ^^^^^ << not a released version
For some unfathomable reason, Red Hat included in release 5.2 a beta
test version of Perl instead of an official version. Surprise, surprise,
it has bugs in.
This may or may not explain the effects you see, but I'd upgrade to
a respectable Perl version before proceeding further.
Mike Guy
------------------------------
Date: 15 Jan 1999 19:04:34 GMT
From: schip@lmsc.lockheed.com (Jan Schipmolder)
Subject: Re: glob error
Message-Id: <77o3g2$8iu5@svlss.lmms.lmco.com>
Etienne Pollard (not@giving.it.out) wrote:
: Tad McClellan wrote:
:
snip
: >
: > You cut/pasted it into this article, or you typed it in?
It must have been typed, since it's not !# but #!
: !#/usr/bin/perl
:
: @another = </home/webroot/*>;
--
jan.b.schipmolder@lmco.com
------------------------------
Date: Fri, 15 Jan 1999 13:59:06 -0500
From: Chandana Divi <cdivi@eagledev.com>
To: chandana@shore.net
Subject: How to build perl as a dll on NT
Message-Id: <369F8FFA.C7942213@eagledev.com>
Can anyone help me to build perl as a dll on Windows NT
These are the steps I followed and failed to achieve what I want to...
I used VC++5.0 to build.
I edited the Makefile as given in the readme files.
Then opened it as a workspace in VC++ and built it.
It built successfully and resulted in the perlcore.dll which I was
looking for to use with my executable.
But when I link this, I get lot of 'unresolved external symbols' errors
for definitions from the perlcapi.h file. How do I solve this?
My requirement is to have something similar to the calling 'main'
function
specified in the miniperl.c, so I can execute the perlscript through my
c++ code.
I wrote a .cpp file with similar code and used the perlparse, perlrun
functions and
ended up with the link errors. (I had no problems using the Perl5.004
version)
The previous version of perl 5.004 had all .cpp files in the source and
was
very easy to build a dll and use with an executable. But this version of
activestate perl has all c files in multiple directories and is creating
all kinds of errors.
Any idea if c files will be replaced with .cpp files?
I appreciate your comments
thanks in advance
Chandana
------------------------------
Date: Fri, 15 Jan 1999 17:59:57 -0500
From: "Danny" <dstern@aschwebhosting.comnospam>
Subject: Re: HTML Form --> PERL "print" ?? (help!)
Message-Id: <77o3b4$2le$1@winter.news.rcn.net>
Although no one replied, I managed to fix the code.
Thanks ayway =)
Danny wrote in message <77o2iv$r9i$1@winter.news.rcn.net>...
>Yes, I fixed the two "{" that should be "(", but it still does not work.
>Danny wrote in message <77o0uk$jee$1@winter.news.rcn.net>...
>>I have a HTML form which accesses a PERL script to verify a credit card.
I
>>want to output the credit card information (which was typed in the HTML
>>form) in the new page that the PERL script creates. I've tried
>> print $FORM{'cardnumber');
>>But, it doesn't seem to work correctly.
>>My entire printing code is:
>> print "Your credit card has been approved. Please print the following
>>form: \n";
>> print "<table border=0 cellspacing=0 cellpadding=0><tr><font face=\"ms
>>sans serif\" color=black size=5> \n";
>> print "Order Form</font></tr></table><table border=0 cellspacing=0
>>cellpadding=0><tr><td width=150>Card Number</td><td width=100>Item</td><td
>>width=250>Decsription</td><td width=100>Price</td></tr> \n";
>> print "<tr><td width=150> \n";
>> print $FORM('cardholder');
>> print "<BR> \n";
>> print $FORM{'cardnumber');
>> print "<BR> \n";
>> print $FORM('cardexp');
>> print "</td><td width=100> \n";
>> print $FORM('item');
>> print "</td><td width=250> \n";
>> print $FORM('des');
>> print "</td><td width=100> \n";
>> print $FORM('price');
>> print "</td></tr></table> \n";
>> print "Thank you for your order\!\n";
>>I'm fairly new to PERL, so there could be some other stupid mistake above.
>>Let me know, thanks.
>>
>>Danny
>>
>>
>
>
------------------------------
Date: 15 Jan 1999 20:05:13 GMT
From: schilli@tep.e-technik.tu-muenchen.de. (Michael Schilli)
Subject: LWP::UserAgent: Basic Authorisation Bug
Message-Id: <77o71p$ka3$1@sparcserver.lrz-muenchen.de>
Hi Gisle, hi folks,
LWP::UserAgent changed from version 1.62 to 1.64 in that the
basic authorisation scheme does no longer work as expected
(and documented):
credentials("http://abc.com", "realm", "uname", "passwd");
does no longer work, it has to be
credentials("http://abc.com:80", "realm", "uname", "passwd");
Otherwise the user agent won't provide the authorisation information
necessary and the request will fail.
The reason for this is line 404 in LWP::UserAgent 1.64 which is
now
my $host_port = $uri->host_port;
instead of
my $host_port = $uri->netloc;
as of version 1.62. Is this intended? I for sure was confused and it
took me quite a while to figure out why my scripts wouldn't run
anymore.
Just to let you know!
-- Mike
------------------------------
Date: Fri, 15 Jan 1999 19:25:41 GMT
From: christian.arandaNOSPAM@NOSPAMiiginc.com (Christian M. Aranda)
Subject: more efficient error handling
Message-Id: <77o4dm$blt$1@news-1.news.gte.net>
Folks -
I've been trying to find a more efficient way to handle errors in my
script, but have come up short. Here is what I have thus far:
$conn = &VanOpenConnection($vantive_id, $vantive_pw, $vantive_host,
$vantive_port);
&err_msg("fatal", "Unable to connect to $vantive_host",
"VanOpenConnection", $conn) if ($conn < 0);
&VanOpenConnection returns a negative number if it doesn't execute
properly. I don't, however, need to save the number it returns. I
thought of using || die much in the same way you would with opening
files, but I don't believe that evaluates properly.
All suggestions welcome --
------------------------------
Date: Fri, 15 Jan 1999 14:50:32 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: open path problems
Message-Id: <369F9C07.79C136FD@cthulhu.demon.nl>
colin@hpj.co.uk wrote:
>
> I have a directory off the web root called cgi-bin. This is set as a virtual
> directory (IIS 4). In the cgi-bin there is a perl script that attempts to
> open a file in the root. It always failes. Everybody (IUSER_xxx included) has
> god rights to everywhere (just to rule out permission problems). If I open a
> file in cgi-bin it's fine. What's up? Any help appreciated.
And what is the error message contained in the $! variable after the open
has failed?
Perhaps your question should be asked in a newsgroup discussing setup of
webservers ?
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: 15 Jan 1999 20:42:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl Criticism
Message-Id: <77o97e$pvg$2@marina.cinenet.net>
Michael D. Schleif (mds-resource@mediaone.net) wrote:
: Craig Berry wrote:
: > Michael D. Schleif (mds-resource@mediaone.net) wrote:
: > : Yes, a single, discrete element can also be a subset of a set of
: > : elements.
: >
: > No it can't; it can be a member (perhaps the only member) of a subset,
: > however.
:
: subset n : a set each of whose elements is an element of an inclusive
: set
Note the distinction between elements (aka members) and sets. A set has
elements. An element is not a set. An element is in a set.
: Clearly, one (1) is a number. Depending on *your* sources and context,
: a set of one (1) is trivial, but entirely possible. A set of one (1)
: obviously qualifies by this definition of subset.
Of course. My only point is that A is different from { A } -- that is,
the element A is different from the set containing only the element A.
: Would you say, therefore, that a subset *is not* a member of any set?
No. Sets can be elements in other sets (or in themselves, if you get into
the weirder limits of set theory).
: Or, that a set *cannot* be a member of a greater, but at this moment
: unknown, set?
Of course not. A set is an element of a potentially infinite number of
sets.
: If a group of members can be a subset of some set and you
: remove one member at a time from that group, at what point is that
: `group' no longer a subset?
Careful with the wording here. If your group is a set which is itself a
member of the larger set, removing the last member leaves the empty set as
a member of the larger set. If the group is just part of the list of
members of the larger set, then removing the last member of the group
leaves an empty subset.
[snip]
: > Similarly, fuzzy concepts like "scripting language" allow us to reason
: > about languages about which we know almost nothing. The danger is that we
: > may draw false conclusions, or misclassify languages, but again,
: > categorization works because/when it's right more often than not.
:
: Craig, come on! What you have written is clear to me and with it, in
: and of itself, I take no issue. Simply because we can distinguish
: between any two (2) entities, is that reason to change either?
Of course not, and I didn't say or imply so.
: Is topmind's contention that Perl should be changed simply because we
: *can* discern between scripting and non-scripting languages? IMHO, it
: appears that he `implies' that their is something intrinsically *wrong*
: with scripting languages -- proof of that is _what_ I do not see . . .
He does, and I disagree. I simply felt the need to defend one small part
of his argument from unwarranted attack. I have this quixotic streak in
me at times. :)
: That that proof may, indeed, be explicit in his arguments, and that I
: simply *do not* see it, is possible. Enlighten me ;)
I'll have to leave that to him, I'm afraid.
--
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "The hills were burning, and the wind was raging; and the
clock struck midnight in the Garden of Allah."
------------------------------
Date: 15 Jan 1999 18:59:41 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Problem with legacy Perl script
Message-Id: <77o36t$pe0$1@pegasus.csx.cam.ac.uk>
Brian Capouch <brianc@palaver.net> wrote:
>It's an unpack, using the template in the following string:
>
>$headformat = "A2, A9, A21, A10, A7, A3, A7, A6, A6, A6";
>And here's the error I get under Perl 5. (It works flawlessly in Perl
>4):
>
>Invalid type in unpack: ',' at ./roster.pl line 75, <ROSTERS> chunk 4.
Whenever you get an error you don't understand from Perl, as a
first step look it up in "perldoc perldiag". (Or have Perl do it
for you automatically, by going "use diagnostics:". Or use the
"splain" script.) In this case, we find
Invalid type in unpack: '%s'
(F) The given character is not a valid unpack type. See
the unpack entry in the perlfunc manpage. (W) The given
character is not a valid unpack type but used to be
silently ignored.
Note that "used to be silently ignored".
So just delete the incorrect and redunndant commas, and all should
be well.
Mike Guy
------------------------------
Date: 15 Jan 1999 11:16:10 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: Problem with legacy Perl script
Message-Id: <77o45q$h@journal.concentric.net>
brianc@palaver.net (Brian Capouch) writes:
>Invalid type in unpack: ',' at ./roster.pl line 75, <ROSTERS> chunk 4.
Yank the commas from the template string. Keep the spaces, however.
--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"
------------------------------
Date: Fri, 15 Jan 1999 11:25:28 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem with legacy Perl script
Message-Id: <MPG.11093604ed425f6e989995@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <369F6C68.7D69C3@palaver.net> on Fri, 15 Jan 1999 11:27:20 -
0500, Brian Capouch <brianc@palaver.net> says...
...
> $headformat = "A2, A9, A21, A10, A7, A3, A7, A6, A6, A6";
...
> And here's the error I get under Perl 5. (It works flawlessly in Perl
> 4):
>
> Invalid type in unpack: ',' at ./roster.pl line 75, <ROSTERS> chunk 4.
As perl complained about a comma in the unpack format, have you tried
removing the commas?
Sheesh...
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 15 Jan 1999 19:58:38 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Problem with legacy Perl script
Message-Id: <369F9FBD.5813A18B@home.com>
Cameron Kaiser wrote:
>
> Yank the commas from the template string. Keep the spaces, however.
For readability only. The spaces are not necessary. These are
equivalent:
unpack "A2 A9", $scalar;
unpack "A2A9", $scalar;
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Fri, 15 Jan 1999 10:53:43 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: reading and returning data from a file
Message-Id: <369F6485.9853FC10@cthulhu.demon.nl>
Mike O'Brien wrote:
>
> Hi everyone.
>
> How can I search a text file for | , return the numeric position, search
> for | again,return the position subtract the two and then return the
> lenght of the data inbetween the two |'s. Depending on the data's length
> I want to read it in to an scalar.
>
> Any ideas?
Sure, look in the thread 'Searching a string, with a headache', it seems
there are more people trying to solve exactly the same problem.
Erik
------------------------------
Date: Fri, 15 Jan 1999 20:27:23 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Regex challenge
Message-Id: <36a0a051.1190005@news.skynet.be>
Eric Smith wrote:
>1) I want to match a word, say `table' but the character \& or ampersand
>can appear anywhere in table so all these are legal:
>\&table
>t\&able
>ta\&ble
>... [snip] ...
>table\&
>
>any elegant solutions for my regex?
I would attempt killing the ampersands, and then match /table/. It
depends on how many ampersands you're willing to accept. You could
always doublecheck if you have a reasonable candidate.
>2) I want to march a lower case, upper case or mixed word and _replace_ it
>with the same case layout in the new word
>so
>Table becomes Chair
>TABLE becomes CHAIR
>table becomes chair
Wait a minute... I've done this once... But I didn't use just a regex,
though. More something like:
s/\b(table)\b/©case('chair',$1)/ige;
with
sub copycase {
my($replace,$orig) = @_;
if($orig eq uc($orig)) {
return uc $replace;
} elsif($orig eq lc($orig)) {
return lc($replace);
} elsif($orig eq "\uL$orig" {
return "\u\L$replace";
} else {
# oh, well...
return $replace;
}
}
Bart.
------------------------------
Date: Fri, 15 Jan 1999 11:20:44 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Running Perl scripts for Macs
Message-Id: <369F6AD9.CDFD85BF@cthulhu.demon.nl>
dturley@pobox.com wrote:
>
> In article <369DFF33.5500@berbee.com>,
> ringwood@berbee-no-spam-.com wrote:
>
> > The total parts of the code that were non-platform specific was
> > about 98% (I did count at one point). That's pretty darn good and
> > tells me that while there are gotcha's, Perl is as close to
> > cross platform as anything.
>
> Really makes you wonder why Java and not Perl gets all the cross-platform
> hype. Java is about as c-p as, well, gee, I can't think of anything less
> cross- platform. :-)
Isn't the meaning of cross-platform:
Move it to another platform and cross your fingers that it works ?
Erik
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: 15 Jan 1999 18:59:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Set current position in a file
Message-Id: <77o373$899$5@client2.news.psi.net>
Giga Tron (gigatronman@email.com) wrote on MCMLXIII September MCMXCIII in
<URL:news:369f49c7.5755816@news.mtt.net>:
&&
&& how can I set the current position in a file. do something and then
&& continue from that position
seek
Abigail
------------------------------
Date: 15 Jan 1999 20:46:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Small script required.
Message-Id: <77o9fu$a0o$1@client2.news.psi.net>
Steve Leibel (stevel@coastside.net) wrote on MCMLXIII September MCMXCIII
in <URL:news:stevel-1401991914010001@192.168.100.2>:
`` In article <369e7a34$0$13736@fountain.mindlink.net>, "Rob Annandale"
`` <rob_aNOSPAM@unipharm.com> wrote:
``
``
`` > I cannot wait for the book to arrive from Amazon in 7 to 14 days to learn
`` > how to do a really simple procedure for now, so I hope someone here can help
`` > me.
`` >
``
`` Of course a nontechnical solution is to request next-day air.
Or you drive to the bookstore.
Abigail
------------------------------
Date: Fri, 15 Jan 1999 18:55:58 GMT
From: mike@mjm.co.uk
Subject: Re: tricky question.. possible???
Message-Id: <369f8ecf.7692362@nntp.netcom.net.uk>
On Fri, 15 Jan 1999 11:57:43 -0500, "Paul Murphy" <outline@p3.net>
wrote:
>I am wondering if anyone knows of a way with either perl or javascript to
>read the location of a certain frame? If i have a button on a top frame,and
>a changing lower frame, i want the button when click to send the url to my
>server of the lower frame.
>
One way to do this could be to use server side on the bottom page that
writes an identifier to a file stored on the server. When the button
is clicked, it can read in the variable which would refer to the
appropriate page.
Hope this helps,
Mike
Mike
MjM Computer Publishing
http://www.mjm.co.uk
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4661
**************************************