[22250] in Perl-Users-Digest
Perl-Users Digest, Issue: 4471 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 27 11:06:32 2003
Date: Mon, 27 Jan 2003 08:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 27 Jan 2003 Volume: 10 Number: 4471
Today's topics:
Array slice - but using hash ref <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Re: Array slice - but using hash ref <bongie@gmx.net>
Re: Array slice - but using hash ref <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Re: can i drop into the debugger programmatically? (Peter Scott)
Re: Changing the context of a code block <nobull@mail.com>
Re: Changing the context of a code block (Anno Siegel)
Re: Changing the context of a code block <eric.anderson@cordata.net>
Re: Changing the context of a code block <eric.anderson@cordata.net>
Re: Changing the context of a code block <steven.smolinski@sympatico.ca>
Re: How to make standalone perlscript <oonplnhd02@sneakemail.com>
Re: How to make standalone perlscript (Joe Smith)
Re: How to make standalone perlscript <bigj@kamelfreund.de>
Re: Need help with split (Joe Smith)
Re: newbie perl pattern processing question <perl-dvd@darklaser.com>
Re: Perl say that 100.01 is greater than 100.01 !!!!!!! <ron@savage.net.au>
Problems with opening files using Bioperl(Bio::SearchIO (Marcus Claesson)
Re:Ben Morrow : How to make standalone perlscript <t18_pilot@hotmail.spam.com>
Reply to Ben Morrow : How to make standalone perlscript <t18_pilot@hotmail.spam.com>
Re: Reply to Ben Morrow : How to make standalone perlsc (Ben Morrow)
Re: script <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: To create a static html page with perl script from (Chas Friedman)
Re: unlink() (Joe Smith)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 27 Jan 2003 10:27:23 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Array slice - but using hash ref
Message-Id: <b131ik$76c$1$8300dec7@news.demon.co.uk>
Given an array @arr and a hash %hash, I know (from perlref, perllol,
perldsc) that I can isolate the values of %hash, keyed by the members of
@arr, with this:
my @selected_values = @hash{ @arr }
But how can I do this using a reference $hash_ref to a hash, got from:
$hash_ref = \%hash;
The standard manuals on references don't seem to discuss array slices, and
vice versa.
The reason I am working with a hash reference is because that is what I pass
into my function:
my %hash = ( . . . );
. . .
func( \%hash );
. .
sub func {
my $hash_ref = shift;
. . . # Do something this array slice
return 1;
}
At the moment, in the function, I am forced to copy from the hash reference
to a local hash, slice it, then remember to copy the changed local hash back
to the hash reference before returning:
sub func {
my $hash_ref = shift;
my %hash = %{ $hash_ref };
. . . # Do something with array slice
%{ $hash_ref } = %hash;
return 1;
}
I want to avoid these 2 greedy copy operations, and use just the hash ref.
Regards,
Clyde
------------------------------
Date: Mon, 27 Jan 2003 11:34:07 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: Array slice - but using hash ref
Message-Id: <1324335.edOj7MS0eT@nyoga.dubu.de>
Clyde Ingram wrote:
> Given an array @arr and a hash %hash, I know (from perlref, perllol,
> perldsc) that I can isolate the values of %hash, keyed by the members
> of @arr, with this:
>
> my @selected_values = @hash{ @arr }
>
> But how can I do this using a reference $hash_ref to a hash, got from:
>
> $hash_ref = \%hash;
my @selected_values = @{$hash_ref}{ @arr };
and even
my @selected_values = @$hash_ref{ @arr };
work like a charm.
Ciao,
Harald
--
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"One word sums up probably the responsibility of any Governor, and
that one word is 'to be prepared'."
-- George W. Bush Jr.
------------------------------
Date: Mon, 27 Jan 2003 10:46:31 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: Array slice - but using hash ref
Message-Id: <b132mc$jnt$1$8302bc10@news.demon.co.uk>
Harald,
"Harald H.-J. Bongartz" <bongie@gmx.net> wrote in message
news:1324335.edOj7MS0eT@nyoga.dubu.de...
<SNIP>
> my @selected_values = @{$hash_ref}{ @arr };
> and even
> my @selected_values = @$hash_ref{ @arr };
> work like a charm.
>
> Ciao,
> Harald
Really that easy? I thought I tried that . . .
Apologies to you and other readers. A quick scan of Google throws up this
same question asked a year ago by Kevin Baker (4-Jan-2002) and answered same
day by Matthew Rice, Tad McClellan, and Brian McCauley. For example:
Apply "Use Rule 1" from
perldoc perlreftut
Start with the way you have it above:
print @hash{@list};
replace the hash name with an empty (for now) block:
print @{}{@list};
put something into the block that returns a reference to a hash:
print @{$href}{@list};
Alteratively apply "use rule 1" from perlref.
print @$href{@list}
(Note that "use rule 1" in perlreftut is "use rule 2" in perlref).
The prelreftut document seeks to simplify matters by omitting the
simplest way to use references. Hmmm... :-)
Regards,
Clyde
------------------------------
Date: Mon, 27 Jan 2003 15:40:15 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: can i drop into the debugger programmatically?
Message-Id: <zpcZ9.130387$sV3.4959520@news3.calgary.shaw.ca>
In article <87k7grn8fl.fsf@mit.edu>,
Alex Coventry <throwaway@mit.edu> writes:
>
>hi. does perl have a cognate of python's pdb.set_trace? in python,
>calling this function drops you into the debugger in the context at
>which it was called.
You can't invoke the debugger unless perl was invoked with -d.
However, once the program is running, you can break out to the
debugger prompt programmatically by setting $DB::single. See
"Debugging compile-time statements" in the perldebug man page.
--
Peter Scott
Perl classes in Los Angeles: http://www.psdt.com/services/classes/
------------------------------
Date: 27 Jan 2003 09:07:13 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Changing the context of a code block
Message-Id: <u9bs230xmm.fsf@wcl-l.bham.ac.uk>
"Eric Anderson" <eric.anderson@cordata.net> writes:
> On Sun, 26 Jan 2003 18:42:45 +0000, Uri Guttman wrote:
> > ...i think you still have an XY problem. you are specifying a design
> > need but not a requirements spec. why do you need to design such on the
> > fly things? there are many ways to do it. look at class::classless for
> > one. each object has its own unique class and can be created anytime.
>
> OK, let me try to give you an idea of what I am after. [...]
> ...If the syntax is also pluggable, and the keyword plugins
> simply specify their keywords and info about those keywords then the
> framework could allow alternate syntax that might make more sense.
True pluggable syntax is not available in Perl5 (it is in Perl6) but
you can fake it with source filter modules.
I don't really see how this 'X' is related to the orginial question
'Y' of retrospecively changing the value of __PACKAGE__ in already
compiled code.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 27 Jan 2003 10:45:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Changing the context of a code block
Message-Id: <b132kv$4nd$1@mamenchi.zrz.TU-Berlin.DE>
Eric Anderson <eric.anderson@cordata.net> wrote in comp.lang.perl.misc:
> On Sun, 26 Jan 2003 18:42:45 +0000, Uri Guttman wrote:
>
> >>>>>> "EA" == Eric Anderson <eric.anderson@cordata.net> writes:
> >
> > EA> On Sun, 26 Jan 2003 04:21:32 +0000, Uri Guttman wrote:
> > >> that makes little sense. you still haven't given a big picture and a
> > >> reason why you want it. manipulating an object definition can be easy
> > >> or hard depending on the manipulation needed. so you have to be much
> > >> more specific and give the proper picture. your internal
> > >> understanding is useless to others without properly communicated
> > >> requirements.
> >
> > EA> The manipulation I want to do is fairly simple. I want a interface
> > EA> that allows me to specify object names, their attributes, and EA>
> > their methods. Then my interface will mess with the symbol table EA> to
> > create an object as specified.
> >
> > objects don't have names. objects don't live in symbols tables. you can
> > create classes on the fly and bless objects into them. given what you say
> > there i think you still have an XY problem. you are specifying a design
> > need but not a requirements spec. why do you need to design such on the
> > fly things? there are many ways to do it. look at class::classless for
> > one. each object has its own unique class and can be created anytime.
>
> OK, let me try to give you an idea of what I am after. Perl has a very
> simple form of expressing an object. It is just a package with some
> functions.
No. That's how *classes* are realized in Perl OO, not objects.
> Once a variable is blessed with that package name it becomes an
> object.
Imprecise. Not the variable is blessed, but the data it refers to
(provided the variable contains a reference). Anonymous data structures
can be objects too.
[sketch of ambitious plan snipped]
This isn't the first time in this thread that you give the impression
of being not entirely clear about the relationship among the terms
"class", "object" and "method" (and the role of the symbol table in
these). A clear understanding of these notions is a prerequisite not
only for the design of a meta-OO system (a system to generate OO
systems) like you have in mind, but also for communicating about it.
Anno
------------------------------
Date: Mon, 27 Jan 2003 09:37:48 -0500
From: "Eric Anderson" <eric.anderson@cordata.net>
Subject: Re: Changing the context of a code block
Message-Id: <pan.2003.01.27.14.37.40.570550@cordata.net>
On Mon, 27 Jan 2003 09:07:13 +0000, Brian McCauley wrote:
> True pluggable syntax is not available in Perl5 (it is in Perl6) but you
> can fake it with source filter modules.
Yes, source filters are similar to what I am trying to do, as are C
macros.
> I don't really see how this 'X' is related to the orginial question 'Y' of
> retrospecively changing the value of __PACKAGE__ in already compiled code.
It doesn't have much to do with it. What I stated in the last message is the
big picture of it all, because everybody seems to want to know that before
they answer my original question which is just an implementation detail.
Since it is just an implementation detail it doesn't have much to do with
the big picture other than it is one way to solve my problem.
My problem is that the developer will give my framework a block of code,
and my framework will need to install that block in the symbol table as if
it was part of the package. Also, that block will behave exactly as if the
developer had written the entire package by hand instead of using some of
my extended syntax.
I can't currently do that when simply executing the block after assigning
it in the symbol table because __PACKAGE__ and caller() will not function
as expected. I was wondering if there is any way to make it function as
expected. If there is not then I will have to find another way to solve my
problem. The big picture of what I am doing does not change. Just how I
solve this implementation detail does. Another way I could do it is read
the source file itself, get the function as a string, prepend "package X"
and then eval the code. But using a string doesn't give me the compile
time check like using a block does so I would prefer to use the block if I
can make it behave like I want.
Anyway I think this issue has been discussed to death by now. I'm
obviously not communicating clearly so I will just have to figure it out
myself or use another solution. Thanks for your attempts at helping me
anyway.
--
Eric Anderson
------------------------------
Date: Mon, 27 Jan 2003 09:46:33 -0500
From: "Eric Anderson" <eric.anderson@cordata.net>
Subject: Re: Changing the context of a code block
Message-Id: <pan.2003.01.27.14.46.31.389277@cordata.net>
On Mon, 27 Jan 2003 10:45:51 +0000, Anno Siegel wrote:
> Imprecise. Not the variable is blessed, but the data it refers to
> (provided the variable contains a reference). Anonymous data structures
> can be objects too.
>
I apologize for the imprecision. I realize that anonymous data structures
can be objects too. I just don't use them often. I'll keep that in mind in
future discussions.
> [sketch of ambitious plan snipped]
I hope it isn't too ambitious. :) I got other things I want to do also. I
already have a large chunck of what I want to do working and it hasn't
been too time consuming thus far. I hope to finish the rest of what I want
soon.
> This isn't the first time in this thread that you give the impression of
> being not entirely clear about the relationship among the terms "class",
> "object" and "method" (and the role of the symbol table in these). A
> clear understanding of these notions is a prerequisite not only for the
> design of a meta-OO system (a system to generate OO systems) like you have
> in mind, but also for communicating about it.
Perhaps... But since this is for the most part just a hobby project of
mine I don't care if I might not succed. If I do it will be great, if not
then I hope I learn a lot along the way. I generally find that the best way
to learn is to do. So if I don't have a good understanding of what a
"class", "object" and "method" is then hopefully I will as I develop this
project. But personally I think I have a better understanding of it than
you assume. I am just horrible at communicating what I am thinking.
--
Eric Anderson
------------------------------
Date: Mon, 27 Jan 2003 15:07:13 GMT
From: Steven Smolinski <steven.smolinski@sympatico.ca>
Subject: Re: Changing the context of a code block
Message-Id: <BWbZ9.1402$nD1.237423@news20.bellglobal.com>
Eric Anderson <eric.anderson@cordata.net> wrote:
> On Mon, 27 Jan 2003 10:45:51 +0000, Anno Siegel wrote:
>> Imprecise. Not the variable is blessed, but the data it refers to
>> (provided the variable contains a reference). Anonymous data
>> structures can be objects too.
>>
>
> I apologize for the imprecision. I realize that anonymous data
> structures can be objects too. I just don't use them often. I'll keep
> that in mind in future discussions.
Wow, that's practically all I've ever used, or seen used. Take this
snippet from a contructor:
my $self = { _option => $value };
bless $self, $class;
return $self;
It just doesn't seem right to name it, when you're just going to return
a ref anyway:
my %self = ( _option => $value );
bless \%self, $class;
return \%self;
Just looks odd to me.
Steve
--
Steven Smolinski => http://arbiter.ca/
GnuPG Public Key => http://arbiter.ca/steves_public_key.txt
=> or email me with 'auto-key' in the subject.
Key Fingerprint => 08C8 6481 3A7B 2A1C 7C26 A5FC 1A1B 66AB F637 495D
------------------------------
Date: Mon, 27 Jan 2003 08:28:58 GMT
From: Mac <oonplnhd02@sneakemail.com>
Subject: Re: How to make standalone perlscript
Message-Id: <81el6zgfci.fsf@kwikemart.springfield.se>
En dag, närmare bestämt 2003-01-26, plitade Randal L. Schwartz ner:
>>>>>> "William" == William Hymen <t18_pilot@hotmail.spam.com> writes:
>
> William> I need to distribute a standalone perlscript
> William> "tarfile.pl" in my company. It bundles a directory
> William> tree into a tarfile. I do not want to run around and
> William> install Perl or the GNU toolset everywhere.
>
> See PAR in the CPAN.
I can't find this. I always seem to find *to much* when searching
CPAN.
How do I search CPAN efficiently?
/mac
------------------------------
Date: Mon, 27 Jan 2003 09:25:19 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: How to make standalone perlscript
Message-Id: <3W6Z9.2917$io.117581@iad-read.news.verio.net>
In article <81el6zgfci.fsf@kwikemart.springfield.se>,
Mac <oonplnhd02@sneakemail.com> wrote:
>En dag, närmare bestämt 2003-01-26, plitade Randal L. Schwartz ner:
>
>>>>>>> "William" == William Hymen <t18_pilot@hotmail.spam.com> writes:
>>
>> William> I need to distribute a standalone perlscript
>> William> "tarfile.pl" in my company. It bundles a directory
>> William> tree into a tarfile. I do not want to run around and
>> William> install Perl or the GNU toolset everywhere.
>>
>> See PAR in the CPAN.
>
>I can't find this. I always seem to find *to much* when searching
>CPAN.
>
>How do I search CPAN efficiently?
Goto http://search.cpan.org and enter PAR in the search box.
The first hit is what you want.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Mon, 27 Jan 2003 13:55:33 +0100
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: How to make standalone perlscript
Message-Id: <pan.2003.01.27.08.21.08.398754@kamelfreund.de>
On Mon, 27 Jan 2003 08:28:58 +0000, Mac wrote:
>> See PAR in the CPAN.
>
> I can't find this. I always seem to find *to much* when searching
> CPAN.
>
> How do I search CPAN efficiently?
http://search.cpan.org/search?query=PAR&mode=all
It's the first item listed.
Cheerio,
Janek
------------------------------
Date: Mon, 27 Jan 2003 08:20:07 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: Need help with split
Message-Id: <XY5Z9.2913$io.117581@iad-read.news.verio.net>
In article <8nOS9.19977$134.2109553@newsread1.prod.itd.earthlink.net>,
Jodyman <Jodyman@hotmail.com> wrote:
>
>"Joe Smith" <inwap@inwap.com> wrote in message
>news:DTxS9.1778$io.80756@iad-read.news.verio.net...
>> In article <kAtS9.20841$9N5.1871632@newsread2.prod.itd.earthlink.net>,
>> Jodyman <Jodyman@hotmail.com> wrote:
>> >I stand by my final answer for even the four\five filename in unix:
>> >my $filename3 = '/home/test';
>> >my $filename4 = '/four\five';
>>
>> Your sub fails for "$filename4 = 'four\five'";
>
>Joe, what version of Perl are you using? Works fine for me. Check it
>again.
Perl for Unix (Solaris).
>Jody
>
>PS - If it fails, what do you get?
It says that the name of the file is 'five'. That is incorrect.
The actual file name is is 'four\five'. That's a nine-character
file name, which does not include any subdirectory components.
In the case of './four\five', the directory component is '.' and the
filename component is 'four\five'.
And don't forget "MacClassic HardDisk:log files:2000/01/27.txt" where the
filename is the part after "files:".
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Mon, 27 Jan 2003 15:44:42 GMT
From: "David" <perl-dvd@darklaser.com>
Subject: Re: newbie perl pattern processing question
Message-Id: <KtcZ9.5$5v6.5330@news-west.eli.net>
"Sol Linderstein" <slinderstein@yahoo.com> wrote in message
news:e435b329.0301202226.10900559@posting.google.com...
> Hi,
>
> I'm not new to programming but I am new to perl. Here's what I want to
> do.
> I have a text file with lines of HTML with special embedded tags in
> it. I want to parse each line of the file and process the tags. A line
> of the input file might look like this:
>
> <A HREF="blahblahblah?id=<<var id>>">blah</A>
>
> or like this:
>
> <INPUT TYPE="HIDDEN" NAME="<<var foo>>" VALUE="<<var bar>>">
>
> So, what I want to do is find the chunks of text surrounded by << >>
> and then process the stuff inside of the double angle brackets,
> replacing the << >> and the stuff inside of it with what my code will
> compute then printing out the processed line. There might be multiple
> of these patterns on each line.
>
> In essence I want to write an HTML pre-processor. "Var" isn't the only
> tag I'm planning to process, by the way.
>
> I think the approach/answer has to do with the split function but I'm
> not sure how to do this.
>
> I'd appreciate a simple example that takes a string and outputs the
> processed string. For simplicity, you can have the "var" tag replace
> the value with a random number. That should illustrate for me how to
> do what I want to do.
Well sol, if I might, I would recommend using the replacement:
<INPUT TYPE="HIDDEN" NAME="<var>foo</var>" VALUE="<var>bar</var>">
for your pre-parser. At my place of employment, we have been using this
for years, and has worked wonderfully.
for parsing, you could use something like the following:
############################################
my %replace_stuff = (
'id' => 31,
'foo' => 'stuff',
'bar' => 'more stuff'
);
my $file = "/path/to/file.html";
my $page = parse_skin($file, \%replace_stuff);
# or
$skin = qq^
<A HREF="blahblahblah?id=<var>id</var>">blah</A>
<INPUT TYPE="HIDDEN" NAME="<var>foo</var>" VALUE="<var>bar</var>">
^;
my $pagea = parse_skin($skin, \%replace_stuff);
### Begin of parse sub ###
sub parse_skin($ \%){
my $skin = shift;
my %replace = %{(shift)};
if (-e $skin){ # if the skin is a file
local $/=undef;
open(SKIN, "<" . $skin);
$skin = <SKIN>;
close(SKIN);
}
$skin =~ s/\<var\>(.*?)\<\/var\>/$replace{$1}/g;
return($skin);
}
############################################
Good Luck,
David
------------------------------
Date: Mon, 27 Jan 2003 10:04:44 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Perl say that 100.01 is greater than 100.01 !!!!!!!!
Message-Id: <b11pkc$1o1e$1@arachne.labyrinth.net.au>
"ilbeduino" <giulio@forteyang.com> wrote in message
news:203a632d.0301250921.38e5a5eb@posting.google.com...
> #!/usr/bin/perl
> #
> # I'VE TRIED THIS SCRIPT ON 2 COMPUTERS:
> #
> # v5.6.1 built for MSWin32-x86-multi-thread
> # v5.6.1 built for i386-linux
> #
> # AND THE RESULT IS ALWAYS THE SAME:
> #
> # !!! 100.01 > 100.01 !!!
> #
> # ANYONE HAVE SUGGESTION???
> #
>
> $A = 100.01;
>
> $b1 = 354.25;
> $b2 = 254.24;
> $B = $b1 - $b2; # $B now should be 100.01
This comment is a fabrication, based on your serious misunderstanding of how
floating point numbers are stored in binary form in a digital computer.
Some floating point numbers can be stored exactly and some can't. That is,
some have to be stored approximately in order to fit in the number of bytes
(bits) available for floating point numbers in the language you are using,
and in the precision you have chosen (eg single precision floats 'v' double
precision floats).
For your homework tonight....
------------------------------
Date: 27 Jan 2003 03:31:55 -0800
From: m.claesson@student.ucc.ie (Marcus Claesson)
Subject: Problems with opening files using Bioperl(Bio::SearchIO) in CGI script
Message-Id: <e818c15b.0301270331.d82b1b@posting.google.com>
Hello,
I want to use Bioperl's blast parser as an cgi script but have run into
some problems. The purpose of the script is for web users to
parse their local blast output files and upload the result file onto my
server.
The Bio::Search module behaves differently than the "PerlCGI-way" to open
files. Here's an example:
Both these methods work fine when I run the script on a local file with
the right permissions:
#!/usr/bin/perl -wT
use CGI qw(:standard);
use Bio::SearchIO;
print $q->filefield(-name=>'file', #A cgi function to browse and
select files to open
-size=>20),$q->br;
print $q->submit(-name =>'upload',
-value =>'Upload file'),$q->br;
if (param('upload')) {
$fh = $q->upload('file');
$in = new Bio::SearchIO(-format => 'blast',
-file => $fh);
while(<$fh>) { #The 'normal' way to output the file contents in the browser
print $_;
}
while($result = $in->next_result) {
etc,etc...
}
}
But when I try to open C:\Temp\blastfile.out from a remote windows station
I get this error message:
Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: ------------- EXCEPTION -------------,
referer: http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: MSG: Could not open C:\Temp\blastfile.out
for reading: No such file or directory, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: STACK Bio::Root::IO::_initialize_io
/usr/lib/perl5/site_perl/5.8.0/Bio/Root/IO.pm:244, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: STACK Bio::Root::IO::new
/usr/lib/perl5/site_perl/5.8.0/Bio/Root/IO.pm:192, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: STACK Bio::SearchIO::new
/usr/lib/perl5/site_perl/5.8.0/Bio/SearchIO.pm:121, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: STACK Bio::SearchIO::blast::new
/usr/lib/perl5/site_perl/5.8.0/Bio/SearchIO/blast.pm:200, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: STACK Bio::SearchIO::new
/usr/lib/perl5/site_perl/5.8.0/Bio/SearchIO.pm:134, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: STACK toplevel
/var/www/cgi-bin/bxbrowser1.pl:25, referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: , referer:
http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
[Mon Jan 27 10:58:38 2003] [error] [client 143.239.131.75] [Mon Jan 27
10:58:38 2003] bxbrowser1.pl: --------------------------------------,
referer: http://nsfm39.ucc.ie/cgi-bin/bxbrowser1.pl
Thus, Bio::Search can't even find the file. But to open it and print the
contents in the 'normal cgi-way' works fine i.e
while(<$fh>) {
print $_;
}
Howcome do you think?
Regards,
Marcus
------------------------------
Date: Mon, 27 Jan 2003 10:46:03 GMT
From: "William Hymen" <t18_pilot@hotmail.spam.com>
Subject: Re:Ben Morrow : How to make standalone perlscript
Message-Id: <L58Z9.5993$U27.556372@newsread2.prod.itd.earthlink.net>
OK- Thanks. Everyone else seems to
have other ideas.
The first 15 lines; and last 11 lines of ActiveState cwd.pm are
(below my reply here)
Do I do a "sub GetCwd {
then &GetCwd(); # later?
How does chdir .. work here?
Thanks in advance - Bill
### first 15 lines ####
package Cwd;
require 5.000;
=head1 NAME
getcwd - get pathname of current working directory
=head1 SYNOPSIS
use Cwd;
$dir = cwd;
use Cwd;
$dir = getcwd;
### first 15 lines ####
### last 11 lines ####
}
# package main; eval join('',<DATA>) || die $@; # quick test
1;
__END__
BEGIN { import Cwd qw(:DEFAULT chdir); }
print join("\n", cwd, getcwd, fastcwd, "");
chdir('..');
print join("\n", cwd, getcwd, fastcwd, "");
### last 11 lines ####
------------------------------
Date: Mon, 27 Jan 2003 10:41:32 GMT
From: "William Hymen" <t18_pilot@hotmail.spam.com>
Subject: Reply to Ben Morrow : How to make standalone perlscript
Message-Id: <w18Z9.5989$U27.556546@newsread2.prod.itd.earthlink.net>
OK- Thanks. Everyone else seems to
have other ideas.
The first 15 lines; and last 11 lines of ActiveState cwd.pm are
(below my reply here)
Do I do a "sub GetCwd {
then &GetCwd(); # later?
How does chdir .. work here?
Thanks in advance - Bill
### first 15 lines ####
package Cwd;
require 5.000;
=head1 NAME
getcwd - get pathname of current working directory
=head1 SYNOPSIS
use Cwd;
$dir = cwd;
use Cwd;
$dir = getcwd;
### first 15 lines ####
### last 11 lines ####
}
# package main; eval join('',<DATA>) || die $@; # quick test
1;
__END__
BEGIN { import Cwd qw(:DEFAULT chdir); }
print join("\n", cwd, getcwd, fastcwd, "");
chdir('..');
print join("\n", cwd, getcwd, fastcwd, "");
### last 11 lines ####
------------------------------
Date: Mon, 27 Jan 2003 13:19:59 +0000 (UTC)
From: mauzo@ux-ma160-15.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Reply to Ben Morrow : How to make standalone perlscript
Message-Id: <b13blv$t0p$1@wisteria.csv.warwick.ac.uk>
"William Hymen" <t18_pilot@hotmail.spam.com> wrote:
>OK- Thanks. Everyone else seems to
>have other ideas.
Having read the reast of this thread :), PAR looks like by far the best
suggestion so far. I should ignore what I said: sorry.
Ben
------------------------------
Date: Mon, 27 Jan 2003 09:07:35 +0100
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: script
Message-Id: <i2q93vsdm3omkr8vs0uargg41fqgvch1tj@4ax.com>
On Sun, 26 Jan 2003 08:34:42 +0200, "Pons" <pons@gmx.li> wrote:
>Greetings
>I am gonna switch to new AIX Orcale system with load balance,
>due to that I have to change the Alias and HOST IP in all
>tnsnames files (tnsname.txt) of my Win2k remote users,
>I do not want to do it manually. I want to write a script
>to search for tnsnames file tnsnames.txt on remote windows
>win2k machines C: and D: and replace it with a new tnsnames,
>then I am going place the script on my FreeBSD Intranet web server
>to be accessd by double click in order to replace the file.
There isn't a single question in your post. Let me ask one - are you
expecting someone to write the script for you? If you are, don't hold
your breath. If you aren't then why not try to write the script
yourself and let us know if you stumble into trouble? Just be specific
when you do ask for help.
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Mon, 27 Jan 2003 15:01:47 +0000 (UTC)
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: To create a static html page with perl script from the command line...
Message-Id: <b13hkr$ce5$1@geraldo.cc.utexas.edu>
__________
You wrote:
>Chas,
>
>Thanks for your reply. The code I gave in my earlier script does the
>following:
>
>It reads the input from the file (names.txt) and splits the fields by
>tab and shows in a web page with Names on the left side and the
>Corresponding Files on the right side in the table.
>
>Would you pl. tell me how I would my second script (test2.pl) would
>write the html page to a local file and call the IE browser?
>
>Thanks,
>JC
>
>> You could write a new script "test2.pl"
>>...............
Read about the open, print and systems commands with perldoc -f open,
perldoc -f print, perldoc -f system. The most annoying part will probably
be specifying the path to the browser executable which may contain a long
sequence of directories some of which have spaces in the names and will
have to be quoted properly (unless the program is already in your path);
you may just have to experiment a bit with that.
Note: The text of your reply to a post should come after the quoted previous
text (or between lines of that quoted material in some cases.)
chas
------------------------------
Date: Mon, 27 Jan 2003 09:11:57 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: unlink()
Message-Id: <xJ6Z9.2916$io.117581@iad-read.news.verio.net>
In article <b0remo$l0l$1@mamenchi.zrz.TU-Berlin.DE>,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>Helgi Briem <helgi@decode.is> wrote in comp.lang.perl.misc:
>> On 24 Jan 2003 11:41:57 GMT,
>> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>>
>> >Alternatively make STDOUT auto-flushing. The second line
>> >of all my scripts reads
>> >
>> > use strict; use warnings; $| = 1;
>>
>> I wonder about this. Randal does the same. Was all
>> the effort OS designers expended on buffering output
>> really that much of a waste? You would have thought
>> they had some reason for doing it.
>
>If STDOUT is actually a terminal (used interactively), the amount
>of output is necessarily small enough for buffering not to matter.
The first one-liner below outputs nothing to the terminal for 30
seconds. The second produces a progress report in realtime.
perl -e ' for (1 .. 30) {print "$_ "; sleep 1}'
perl -e '$|++; for (1 .. 30) {print "$_ "; sleep 1}'
I agree with your statement as long as we acknowlege the difference
between an interactive terminal and a terminal used interactively.
Perl handles the latter by automatically flushing the output when
reading from the terminal. If you are writing a program that outputs
text without newlines and doesn't block for input, then you should
explictly autoflush your handles.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4471
***************************************