[16947] in Perl-Users-Digest
Perl-Users Digest, Issue: 4359 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 18 14:05:38 2000
Date: Mon, 18 Sep 2000 11:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969300317-v9-i4359@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 18 Sep 2000 Volume: 9 Number: 4359
Today's topics:
Re: 2 Questions <no.junk.please.ber@attcanada.net>
Re: 2 Questions (Greg Comeau)
Re: 2 Questions <RedX@mail.dma.be>
Re: 5.6.0 shebang under NT (was Re: how to match the ho (Andrew J. Perrin)
Re: [Q] Two Questions <ren.maddox@tivoli.com>
Re: [Q] Two Questions <hartleh1@westat.com>
Re: Annoying quotation marks! <gellyfish@gellyfish.com>
Re: binmode(): How is OS related with "\n"? <lr@hpl.hp.com>
Re: Can I dynamically create hashes? nobull@mail.com
Re: Can not read arrays from <STDIN> nobull@mail.com
change .i to .cpp but not .ii with regexp. <FX@hasnomail.com>
Re: change .i to .cpp but not .ii with regexp. (Clay Irving)
Comparing two Directories digikidd@sega.net
Difference @ARGV[0] and $filepath=@ARGV[0] <FX@hasnomail.com>
Re: Difference @ARGV[0] and $filepath=@ARGV[0] (John J. Trammell)
Re: Difference @ARGV[0] and $filepath=@ARGV[0] <FX@hasnomail.com>
Re: Difference @ARGV[0] and $filepath=@ARGV[0] nobull@mail.com
Re: Finding the width and height of a GIF <gisle@ActiveState.com>
GLOBs v references to GLOBs (was: using filehandles in nobull@mail.com
Re: how do I alphabetize this? nobull@mail.com
Re: Is this terribly inefficient? <uri@sysarch.com>
Re: Module subroutine not recognized? nobull@mail.com
Need help exporting globals <rlm@pricegrabber.com>
Re: Need help exporting globals (Garry Williams)
Re: Need help exporting globals nobull@mail.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 18 Sep 2000 12:30:09 -0400
From: "Bruce Roberts" <no.junk.please.ber@attcanada.net>
Subject: Re: 2 Questions
Message-Id: <mlrx5.6978$YG5.15154@tor-nn1.netcom.ca>
"Frankie" <frankie@centurytel.net> wrote in message
news:39C5974E.AC51F612@centurytel.net...
> My question is what programming language would you recommend to a
> complete beginner in programming? I've extensive background in various
> environments, so I'm not going to be terribly uneasy with the comp, I'm
> just looking for a good start.
>
> The second, and virtually hand in hand with the first, is where to go
> from there and in what sequence. IOW, I'm thinking (just an example)
> qbasic to Visual Basic to C to C++ etc? And yes, I'm going to throw in
> HTML, but I want to go beyond that.
I'd like to make the case for Pascal as both a beginning and advanced
language - at least the Delphi dialect.
Pascal was initially created as a language that could be used to teach sound
fundamental programming concepts and that encouraged good programming
habits. IMO it does an excellent job meeting these goals; and has been
widely used to teach programming. There are a number of fine texts that
cover introductory programming using Pascal. You'll also find numerous web
resources for both Pascal and Delphi.
The Delphi extensions stay true to the spirit of the initial language design
and provide a true object oriented programming environment. Rather than
learning a "beginners" programming language then switching to one that
provides for more advanced programming, ride the wave of rapid application
development and build directly on initial lessons in Pascal with more
advanced worked. There are not many programming tasks that Delphi can't
handle, all with elegance and sound programming.
------------------------------
Date: 18 Sep 2000 12:58:39 -0400
From: comeau@panix.com (Greg Comeau)
Subject: Re: 2 Questions
Message-Id: <8q5hjv$5s2$1@panix3.panix.com>
In article <mlrx5.6978$YG5.15154@tor-nn1.netcom.ca>,
Bruce Roberts <no.junk.please.ber@attcanada.net> wrote:
>"Frankie" <frankie@centurytel.net> wrote in message
>news:39C5974E.AC51F612@centurytel.net...
>> My question is what programming language would you recommend to a
>> complete beginner in programming? I've extensive background in various
>> environments, so I'm not going to be terribly uneasy with the comp, I'm
>> just looking for a good start.
>>
>> The second, and virtually hand in hand with the first, is where to go
>> from there and in what sequence. IOW, I'm thinking (just an example)
>> qbasic to Visual Basic to C to C++ etc? And yes, I'm going to throw in
>> HTML, but I want to go beyond that.
>
>I'd like to make the case for Pascal as both a beginning and advanced
>language - at least the Delphi dialect.
>
>Pascal was initially created as a language that could be used to teach sound
>fundamental programming concepts and that encouraged good programming
>habits. IMO it does an excellent job meeting these goals; and has been
>widely used to teach programming. There are a number of fine texts that
>cover introductory programming using Pascal. You'll also find numerous web
>resources for both Pascal and Delphi.
>
>The Delphi extensions stay true to the spirit of the initial language design
>and provide a true object oriented programming environment. Rather than
>learning a "beginners" programming language then switching to one that
>provides for more advanced programming, ride the wave of rapid application
>development and build directly on initial lessons in Pascal with more
>advanced worked. There are not many programming tasks that Delphi can't
>handle, all with elegance and sound programming.
I don't have a problem with your facts and even opinion,
except that many languages can fill the shoes that you're discussing.
- Greg
--
Comeau Computing / Comeau C/C++ ("so close" 4.2.44 betas starting)
TRY Comeau C++ ONLINE at http://www.comeaucomputing.com/tryitout
Email: comeau@comeaucomputing.com / WEB: http://www.comeaucomputing.com
------------------------------
Date: Mon, 18 Sep 2000 19:48:23 +0200
From: "RedX" <RedX@mail.dma.be>
Subject: Re: 2 Questions
Message-Id: <8q5khb$ek1$1@news.planetinternet.be>
Start with Pascal. It's an easy to learn language and teaches good
programming habbits. When you learned the basic's you could switch to C or
C++ (or other languages).
Don't bother learning QBasic. it's to limited to make serious programs.
Pascal is as easy as QBasic is and a lot more powerful.
RedX
Frankie <frankie@centurytel.net> schreef in berichtnieuws
39C5974E.AC51F612@centurytel.net...
> My apologies for the cross-post and the broad nature of this question.
> I just can't seem to find the info I want via traditional search
> engines, including Deja News. And please, no flames. I'm not a newbie
> and am aware I'm on thin ice with the cross and the questions. Thanks.
>
> My question is what programming language would you recommend to a
> complete beginner in programming? I've extensive background in various
> environments, so I'm not going to be terribly uneasy with the comp, I'm
> just looking for a good start.
>
> The second, and virtually hand in hand with the first, is where to go
> from there and in what sequence. IOW, I'm thinking (just an example)
> qbasic to Visual Basic to C to C++ etc? And yes, I'm going to throw in
> HTML, but I want to go beyond that.
>
> Again, my apologies if this is an inappropriate post. Or, for that
> matter, too broad. Any help will be greatly appreciated. E-mails are
> welcome (take the ** out per below) but since I'm posing the question, I
> can check all the Groups also. TIA
>
> --
> "I do this really moronic thing that the government doesn't want me to
> do. It is called thinking" - George Carlin
>
>
> Remove * * to reply.
>
> -----------------------------------------------------------------------
> Pursuant to US Code, Title 47, Chapter 5, Subchapter II, ¢227,
> Any and all nonsolicited commercial E-mail sent to this address
> is subject to a download and archival fee in the amount of $500.00 US.
> E-Mailing denotes the acceptance of these terms
> -----------------------------------------------------------------------
------------------------------
Date: 18 Sep 2000 12:07:04 -0400
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: 5.6.0 shebang under NT (was Re: how to match the hole string by first word? (need help))
Message-Id: <ubsxlof9z.fsf@demog.berkeley.edu>
Randy <randy_734@my-deja.com> writes:
> Is there any way to make the shebang "the first line of the script" in
> this kind of a bat file?
>
Well this is rather off-topic, since it's really about DOS
batching. But I would think a crude hack appropriate to the OS might
be to simply stick it at the top:
#!perl -w
@rem = '
etc, etc.
Windows will complain about it but won't stop the batch; then you can
have the rest run smoothly and the shebang will be in the first line
of the script. You might need to use POD or something to 'comment
out' the batch stuff.
All in all it seems like an ugly way of handling it. I'd suggest
instead:
- Use bash for win32, which will execute it correctly;
- Use the shortcut found in the win32 perl faq (can't remember exactly
what it is right now) that associates .pl with being executable;
- Use separate .bat and .pl files for each one;
- Resign yourself to typing 'perl <filename>' to run the script; or
- Get a real operating system that doesn't have such trivial problems.
ap
--
----------------------------------------------------------------------
Andrew Perrin - Solaris-Linux-NT-Samba-Perl-Access-Postgres Consulting
aperrin@igc.apc.org - http://demog.berkeley.edu/~aperrin
----------------------------------------------------------------------
------------------------------
Date: 18 Sep 2000 10:15:18 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: [Q] Two Questions
Message-Id: <m3lmwpybnd.fsf@dhcp11-177.support.tivoli.com>
"Paul Taylor" <pap@sotonians.org.uk> writes:
> Your second example 00.123, gets reported as
> 123.0000 when printed as a decimal float.
>
> Off-hand, I don't know why this happens. Perhaps some of the experts
> can enlighten us.
Wouldn't really consider my self an expert, but what happens is that
this parses as a concatenation of two numbers, the first of which,
00, is parsed as an octal 0, so just becomes "0" when stringified.
Change it to 010.123 and you can see this more clearly.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 18 Sep 2000 13:45:48 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: [Q] Two Questions
Message-Id: <39C654CC.CF8F00BE@westat.com>
Paul Taylor wrote:
>
>
> Your second example 00.123, gets reported as
> 123.0000 when printed as a decimal float.
>
> Off-hand, I don't know why this happens. Perhaps some of the experts
> can enlighten us.
It is now concatinating two numbers (the . operator does this). The 00
(an octal zero) on the left and the integer 123 on the right, producing
0123. Similar but perhaps more obvious concatination happens with the
value 010.123, you get 8123.
$ perl
$foo = 077;
$bar = 00.123;
$bar2 = 00 . 123;
$baz = 010.123;
print "$foo $bar $bar2 $baz\n";
__END__
63 0123 0123 8123
--
Henry Hartley
------------------------------
Date: 18 Sep 2000 07:15:07 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Annoying quotation marks!
Message-Id: <8q4btb$gs7$1@orpheus.gellyfish.com>
On Sun, 17 Sep 2000 19:38:46 +0100 Tigz wrote:
> Thanks evryone I have sorted the fonts out now :)
>
> But i require to change the "Send!" and "logoff" buttons, in to text link,
> how could i do this?
>
The fact that you are using Perl to emit your HTML does not make this a
Perl question - you should ask in some group in the comp.infosystems.www.*
hierarchy.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Mon, 18 Sep 2000 10:13:06 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: binmode(): How is OS related with "\n"?
Message-Id: <MPG.142fecf9fcf7ec7e98ad7f@nntp.hpl.hp.com>
In article <jvn5ss4f1jprj7uvjbgsvnotltre0ooonr@4ax.com> on Sat, 16 Sep
2000 02:51:13 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Alan J. Flavell wrote:
>
> >> To sum up: if it's a binary file, a common guideline is to binmode it,
> >
> >But how does a newbie know what a "binary file" is?
>
> If you plan to read and use it one a byte by byte basis, without any
> conversion, then it's best to treat it as a binary file.
It is perhaps clearer to say that a 'text file' is a file structured
into 'lines'. A 'binary file' is anything else.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 18 Sep 2000 18:16:16 +0100
From: nobull@mail.com
Subject: Re: Can I dynamically create hashes?
Message-Id: <u9zol5fwnz.fsf@wcl-l.bham.ac.uk>
hbpursle@duke-energy.com (Bryce Pursley) writes:
>
> What I want to do is to create a separate hash for each unit that is
> named by the $tid variable.
So you think you want a sybolic referance eh?
Stop thinking that.
Use a hash-of-hashes instead.
> The code below doesn't seem to be
> working. I think all it is doing is creating one hash called %tid
> rather than substituting the variable name for the hash name.
> How do I do what I am wanting?
See perldoc perlref and read up on symbolic references.
Then, when you've done that, _don't_ use them.
> $tid{$timestamp} = [ @tmp ];
Correct syntax would be:
$$tid{$timestamp} = [ @tmp ];
But DO NOT DO THIS. Re-write your code to avoid symbolic references
and use a hash-of-hashes instead.
$tid{$tid}{$timestamp} = [ @tmp ];
BTW: if you'd put a my() in the right place to limit @tmp to the scope
in which its needed you could avoid the overhead of creating a copy of
@tmp:
$tid{$tid}{$timestamp} = \@tmp;
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 18 Sep 2000 18:22:37 +0100
From: nobull@mail.com
Subject: Re: Can not read arrays from <STDIN>
Message-Id: <u9wvg9fwde.fsf@wcl-l.bham.ac.uk>
yzzus1@aol.com (YzzuS1) writes:
> Hello,
> I am very new to Perl and programming. I am using Windows 95 and Perl
> 5.22.
There is no Perl 5.22.
> When I try to read and array from <STDIN> by using control-D or control-Z
> I dump the program. Is there another control character in Windows to just state
> end of file?
I don't think think problem exists in recent versions of Perl.
> Also, how dow you clear the screen? In basic the command is clr.
See FAQ: "How do I clear the screen?"
Note: in Windows shell it's "clr" not "clear" as mentioned in the FAQ.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 18 Sep 2000 19:01:29 +0200
From: "FX" <FX@hasnomail.com>
Subject: change .i to .cpp but not .ii with regexp.
Message-Id: <8q5hli$q0r$1@front5.grolier.fr>
Hi,
I want to change *.i to *.cpp using regexp
here is what i'm using :
foreach $element(@listePti){
$element =~ s/\.i/.cpp/;
}
This is the result
source1.i -> source1.cpp Ok
sisi1.i -> sisi1.cpp Ok
source2.iii -> source2.cppii nok Ok expecting source2.iii
source3.i.i ->source3.cpp.i nok ok expecting source3.i.cpp
I read the perlre.html and it says : $ Match the end of the line
Where should I put it ?????
Thx
FX
------------------------------
Date: 18 Sep 2000 17:24:12 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: change .i to .cpp but not .ii with regexp.
Message-Id: <slrn8scjts.7kc.clay@panix2.panix.com>
On Mon, 18 Sep 2000 19:01:29 +0200, FX <FX@hasnomail.com> wrote:
>I want to change *.i to *.cpp using regexp
>
>here is what i'm using :
>
>foreach $element(@listePti){
> $element =~ s/\.i/.cpp/;
> }
>
>This is the result
>source1.i -> source1.cpp Ok
>sisi1.i -> sisi1.cpp Ok
>source2.iii -> source2.cppii nok Ok expecting source2.iii
>source3.i.i ->source3.cpp.i nok ok expecting source3.i.cpp
>
>I read the perlre.html and it says : $ Match the end of the line
>Where should I put it ?????
$element =~ s/\.i$/.cpp/;
--
Clay Irving <clay@panix.com>
It's easier to fight for one's principles than to live up to them.
- Fred Adler
------------------------------
Date: Mon, 18 Sep 2000 16:54:41 GMT
From: digikidd@sega.net
Subject: Comparing two Directories
Message-Id: <8q5hc6$qvs$1@nnrp1.deja.com>
Here is what I am trying to do and was hoping someone might have an
easier solution:
PART 1
##Basically I am reading two directories and populating arrays with
##the filnames in those directories.
foreach $src(@srcCodes) {
#initialize the bdf array
@bdfFiles = ();
if (-d "$clientDir/$src") {
opendir SRC, "$clientDir/$src" or die("Error:\n");
opendir BDF, "$clientDir/$srcBdfDir" or die("Error:\n");
@srcFile = readdir(SRC);
foreach $bdfFile (readdir(BDF)) {
if ($bdfFile =~ /.bdf$/) {
push(@bdfFiles,$bdfFile);
}
else{
if ($bdfFile =~ /.inx$/) {
system("rm","-f","$clientDir/$srcBdfDir/$bdfFile");
}
}
}
shift(@srcFile);
shift(@srcFile);
if (($#bdfFiles + 1) ne 0) {
##THIS IS A ROUTINE THAT WILL COPY FILES TO DIFFERENT
##DIRECTORIES IF THERE ARE MATCHING FILENAMES IN EACH
##DIRECTORY.
copyFiles(\@srcFile,\$srcOutDir,\$clientKey,\$src,
\$clientDir,\@bdfFiles,\$srcBdfDir);
}
closedir(SRC);
closedir(BDF);
}
##THIS COPYFILES SUB IS WHERE I AM STUMPED.
sub copyFiles(){
##I AM PASSING THE ARRAYS OF FILENAMES FROM THE DIRECTORIES ABOVE
##AND WANT TO BE ABLE TO COMPARE THE SRC DIR TO THE BDF DIR. THE FILE
FORMAT IS:
SRC
1234.txt
BDF
1234.bdf
##SO IF THE NUMERIC PORTION OF THE FILES MATCH THEN I WANT TO DO
##SOMETHING.
Any ideas would be greatly appreciated.
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 18 Sep 2000 17:28:55 +0200
From: "FX" <FX@hasnomail.com>
Subject: Difference @ARGV[0] and $filepath=@ARGV[0]
Message-Id: <8q5c7m$jdu$1@front4.grolier.fr>
Hi,
I'm on a windows system.
I'm using a script with a file path & name as an argument.
So as every MS-Win user I type :
perl myscript.pl c:\folder\file.dat
when using :
mySub{
@LiRep = &getFileLines(@ARGV[0]);
}
it's working :-)
but when using
mySub(@ARG[0]);
mySub{
my $fiRep=@_;
@LiRep = &getFileLines($fiRep);
}
It's not working !!!!
where
sub getFileLines{
my ($reportFileName)=@_;
open(FILEHANDLE,"<$reportFileName");
my @LiT = <FILEHANDLE>;
close(FILEHANDLE);
....
return @LiT;
}
I suppose that there is a problem with the \ and / but I can't figure out
why is the first case working !!!!
Thanks for your answer
FX
------------------------------
Date: 18 Sep 2000 15:48:49 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Difference @ARGV[0] and $filepath=@ARGV[0]
Message-Id: <slrn8sbk32.iu5.trammell@nitz.hep.umn.edu>
On Mon, 18 Sep 2000 17:28:55 +0200, FX <FX@hasnomail.com> wrote:
>Hi,
>
>
>I'm on a windows system.
>I'm using a script with a file path & name as an argument.
>So as every MS-Win user I type :
>
>perl myscript.pl c:\folder\file.dat
>
>when using :
> mySub{
> @LiRep = &getFileLines(@ARGV[0]);
> }
>
>it's working :-)
Marginally. You want $ARGV[0], not @ARGV[0].
You will learn a lot if you 'use strict'.
>but when using
>
> mySub(@ARG[0]);
>
> mySub{
> my $fiRep=@_;
> @LiRep = &getFileLines($fiRep);
> }
>
>It's not working !!!!
Again you're being sloppy -- you want something like
my $fiRep = $_[0]; # note scalar values!
or maybe
my $fiRep = shift;
Did you try printing the value of $fiRep in the subroutine?
That would have answered your question.
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Mon, 18 Sep 2000 19:12:42 +0200
From: "FX" <FX@hasnomail.com>
Subject: Re: Difference @ARGV[0] and $filepath=@ARGV[0]
Message-Id: <8q5iak$cm8$1@front4.grolier.fr>
I would like to use strict but i'm using :
sub main{
find(\&traiteFichiers,@ListeRepertoire);
#here I'm using @ListeHeaders created in traiteFichiers
}
sub traiteFichiers{
if (-d){
print "\nScanning Directoy : $File::Find::name";
}
else{
print "\nAdding File : $File::Find::name";
my @splitFileName = split('/',$File::Find::name);
push(@ListeHeaders,@splitFileName[$#splitFileName]);
}
}
and can't find out how to return the liste of headers in the main sub.
If you've got any idea you're welcome.
thank you.
FX
------------------------------
Date: 18 Sep 2000 18:14:46 +0100
From: nobull@mail.com
Subject: Re: Difference @ARGV[0] and $filepath=@ARGV[0]
Message-Id: <u93dixhbax.fsf@wcl-l.bham.ac.uk>
"FX" <FX@hasnomail.com> writes:
> I'm on a windows system.
> I'm using a script with a file path & name as an argument.
> So as every MS-Win user I type :
>
> perl myscript.pl c:\folder\file.dat
>
> when using :
> mySub{
> @LiRep = &getFileLines(@ARGV[0]);
You should get out of the habit of putting redundant & prefixes on
your function calls. One day you may want to use a function with a
prototype and then the bad habit of always supressing prototype
handling will turn round and bite you.
> }
>
> it's working :-)
Yeah, but please run it with warnings enabled and you'll be told about
using a slice when you probably didn't intend to.
> but when using
>
> mySub(@ARG[0]);
Where is @ARG being set? Get into the habit of using strict and
enabling warnings and Perl will catch typos like this for you.
> mySub{
> my $fiRep=@_;
So that would be the setting $fiRep to number of arguments passed to
mySub().
You probably meant to set $fiRep to the first argument
my ($fiRep)=@_;
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 18 Sep 2000 18:26:41 +0200
From: Gisle Aas <gisle@ActiveState.com>
Subject: Re: Finding the width and height of a GIF
Message-Id: <m3ya0psm2m.fsf@eik.g.aas.no>
mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> On Mon, 18 Sep 2000 12:45:50 GMT,
> Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
> > I was shocked! How could Martien Verbruggen <mgjv@tradingpost.com.au>
> > say such a terrible thing:
> > >On Mon, 18 Sep 2000 09:14:04 GMT,
> > > Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
> > >> Image::Info
> > >
> > >Slightly immature code, I believe? And it doesn't actually support GIF
> > >(yet?).
> >
> > Well my copy says it supports GIF (this is version 0.4 I believe).
>
> Hmmm... Interesting.
>
> $ perl -MCPAN -e shell
> cpan> readme Image::Info
> [snip]
> This Perl extention allows you to extract information from various
> image files. In this alpha release we only support JPEG (plain JFIF
> and Exif) and PNG. Usage is something like this:
> [snip]
> cpan> i Image::Info
> Module id = Image::Info
> CPAN_USERID GAAS (Gisle Aas <gisle@aas.no>)
> CPAN_VERSION 0.05
> CPAN_FILE G/GA/GAAS/Image-Info-0.05.tar.gz
> INST_FILE (not installed)
>
> www.cpan.org only lists 0.04 and 0.05. Maybe you have 0.04?
>
> Anyway, the README for either states that there are only two supported
> formats. But again: maybe that's bogus information.
Yes it is bogus. GIF is also supported. GIF support was added in
version 0.02. I will fix the README for the next release.
> I never bothered downloading it, because it simply looks too immature :)
I never got around to develop if further because it already does what
I need myself. I use it mostly for extracting time stamps and for
keeping track of what digital camera models my friends have.
I don't think it has any problems with finding the dimensions of
images. It can also do things that Image::Size can't, like telling
you the size of every frame in an animated GIF.
--
Gisle Aas
------------------------------
Date: 18 Sep 2000 17:45:02 +0100
From: nobull@mail.com
Subject: GLOBs v references to GLOBs (was: using filehandles in strict mode)
Message-Id: <u9d7i1hcoh.fsf_-_@wcl-l.bham.ac.uk>
tchrist@perl.com (Tom Christiansen) writes:
> In article <u9u2bl356z.fsf@wcl-l.bham.ac.uk>, <nobull@mail.com> wrote:
> >> my $fh = *STDIN;
> >Huh? I don't get it. Doesn't that make $fh a symbolic reference?
> >Evidently not. So just what is the thing in $fh in this case?
>
> A glob.
>
> >my $fh = *STDIN; print ref $fh;
> >
> >But GLOB if I do:
> >
> >my $fh = \*STDIN; print ref $fh;
> >
> >What is the difference between the two cases?
>
> One is a reference. One is not.
>
> >Why does ref() tell me that a scalar containing a typeglob is a plain
> >scalar?
>
> Because a typeglob is not a reference to a typeglob.
> However, they can in most cases be used interchangeably.
I realise all the above, I was really asking a deeper and more
philosophical "why?" about the rationale for the semantics, not the
mechanism.
There are lots of thingies in Perl, scalar, hash, array, glob, file
handle, directory handles, subroutines...
A scalar can hold a scalar value (string, number or reference to a
thingy) but it cannot hold a different thingy. At least that's the
general rule. It can however also "hold a typeglob".
$b = "copy of";
my $a = *b;
*b = \"reference to";
print "\$a = *b creates a $$a to the symbol table entry b";
This I assume is a hang-over from the Perl4 days when typeglobs were
the poor-hacker's references. Typeglobs are references to symbol
table entries.
References to arbirtrary thingies now exist and ref() tells you when
a scalar contains a reference. Why when ref() is applied to a
typeglob does it not report a reference to a symbol table entry?
On a related matter, given a scalar containing a GLOB is it possible
to obtain a reference to that glob other than by going via a symbolic
reference?
my $glob = *A;
my $globref = \*{$glob}; # Fails
my $globref = \*{"$glob"}; # Works under no strict 'refs'
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 18 Sep 2000 18:23:42 +0100
From: nobull@mail.com
Subject: Re: how do I alphabetize this?
Message-Id: <u9u2bdfwbl.fsf@wcl-l.bham.ac.uk>
"matthew shir" <hshir@mediaone.net> writes:
> I want the contents of a list to print out in alphabetical order.
> Any ideas on how to do this? thanks!
sort
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 18 Sep 2000 16:50:31 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Is this terribly inefficient?
Message-Id: <x7vgvtejag.fsf@home.sysarch.com>
>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
BL> To be honest, I don't understand the GRT preference to turn everything
BL> into binary strings. What is wrong with plain and simple preformatted
BL> text strings?
BL> sprintf "%04d%02d%02d", $year, $month, $day
it is a preference of the R in GRT. i initially prefered strings and
sprintf. the paper shows how to do both and you can even mix and match
them. pack generates shorter compare keys and therefore is somewhat
faster. sprintf generates printable keys and can be easier to debug.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 18 Sep 2000 18:22:29 +0100
From: nobull@mail.com
Subject: Re: Module subroutine not recognized?
Message-Id: <u9ya0pfwdm.fsf@wcl-l.bham.ac.uk>
"Dale Greer" <dmgreer@airmail.net> writes:
> I get this in the Apache error.log (names have been changed to protect the
> innocent),
> Undefined subroutine &Module::Function called at myApp/WAP/Session.pm line
> 97, <DATA> line 161.
> This all looks fine to me, and it works on the other person's setup. Why
> won't it work on mine?
Are you perhaps using mod_perl and have recently added
&Module::Function? If so then it's probably a caching issue. Try
restarting Apache and see if the problem goes away. Then take a look
at Apache::StatINC.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 18 Sep 2000 08:56:06 -0700
From: Rob McMillin <rlm@pricegrabber.com>
Subject: Need help exporting globals
Message-Id: <39C63B15.C2B2F9BD@pricegrabber.com>
I have a large number of globals that are effectively constants, in the
same way a C program can import a bunch of constants by including a .h
file. I want them globally available in modules that have "use strict"
turned on. How best to do this? BTW, for various reasons I don't want
these to be constants. In one case, I have an array of items that are
needed by multiple routines.
--
http://www.pricegrabber.com | Dog is my co-pilot.
------------------------------
Date: Mon, 18 Sep 2000 16:13:35 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Need help exporting globals
Message-Id: <Parx5.355$fa2.33889@eagle.america.net>
On Mon, 18 Sep 2000 08:56:06 -0700, Rob McMillin <rlm@pricegrabber.com> wrote:
>I have a large number of globals that are effectively constants, in the
>same way a C program can import a bunch of constants by including a .h
>file. I want them globally available in modules that have "use strict"
>turned on. How best to do this? BTW, for various reasons I don't want
>these to be constants. In one case, I have an array of items that are
>needed by multiple routines.
You want to use a module. This need is so pervasive that there's a
FAQ about it. Try looking at perlfaq7 ("How do I create a module?").
For your need, you would probably create a "blah_h.pm" that will
export the names you want available in your various other name spaces.
The names that you export of course, don't have to be constants.
--
Garry Williams
------------------------------
Date: 18 Sep 2000 17:45:24 +0100
From: nobull@mail.com
Subject: Re: Need help exporting globals
Message-Id: <u9bsxlhcnv.fsf@wcl-l.bham.ac.uk>
Rob McMillin <rlm@pricegrabber.com> writes:
> I have a large number of globals that are effectively constants, in the
> same way a C program can import a bunch of constants by including a .h
> file. I want them globally available in modules that have "use strict"
> turned on. How best to do this?
Make them exportable package variables or functions in a module that
takes Exporter as a base class.
For details: perldoc Exporter
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4359
**************************************