[11600] in Perl-Users-Digest
Perl-Users Digest, Issue: 5200 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 22 15:17:34 1999
Date: Mon, 22 Mar 99 12:00:26 -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 Mon, 22 Mar 1999 Volume: 8 Number: 5200
Today's topics:
Re: [HELP PLS] Reg Exp for "a number" <aqumsieh@matrox.com>
Re: [HELP] How to restrict other sites to link my docum <cassell@mail.cor.epa.gov>
Anyone received this message from DeAnne Pearson? (brian d foy)
Re: array question <cassell@mail.cor.epa.gov>
Re: Change password online script. (Greg Bacon)
Converting currency <terral@cyberplex.com>
Re: Converting currency (Andrew Johnson)
Re: Converting currency <jglascoe@giss.nasa.gov>
Re: Converting currency <jeromeo@atrieva.com>
Re: date in perl under nt (Greg Bacon)
Re: Difficult hex code replacement problem (Bart Lateur)
Re: Help please - can't open .pl file (Bart Lateur)
Re: Http_referer registers page script is called from (brian d foy)
install oraperl <JIEMA1@email.mot.com>
Re: looking for script... <aqumsieh@matrox.com>
Re: looking for script... <jglascoe@giss.nasa.gov>
Newbie in need of help!!! kmyers@syneractive.com
Odd/Even <grichard@uci.edu>
Re: Odd/Even (brian d foy)
Re: Odd/Even <grichard@uci.edu>
Re: Passing @ references into and outof sub procedures. (Earl Hood)
Re: Passing @ references into and outof sub procedures. <spike_YYwhiteYY@YYdellYY.com>
Re: Passing @ references into and outof sub procedures. <jglascoe@giss.nasa.gov>
perl and SSI <jxu@centuple.com>
Perl passing arguements to a Web Page timespinner@my-dejanews.com
Perl returning arguements to a Web Page timespinner@my-dejanews.com
Re: Perl returning arguements to a Web Page (brian d foy)
Re: Perl with SSI (brian d foy)
Re: removing ASCII chars < 32 <cassell@mail.cor.epa.gov>
Re: removing ASCII chars < 32 (Bart Lateur)
Re: removing ASCII chars < 32 (Bart Lateur)
Re: removing ASCII chars < 32 <aqumsieh@matrox.com>
Script to download a file from https site <spark@alertcom.com>
Re: Script to download a file from https site (brian d foy)
Re: Sending/recieving scsi commands - DLT on Solaris (Andreas Karrer)
Re: Statistics for comp.lang.perl.misc <cassell@mail.cor.epa.gov>
UNIX --> WinNT --> Excell Spreadsheet via OLE scott@sboss.net
Re: Weird $_ behavior (Earl Hood)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 22 Mar 1999 13:43:46 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: [HELP PLS] Reg Exp for "a number"
Message-Id: <x3yu2vd74bh.fsf@tigre.matrox.com>
sergei_klimov@my-dejanews.com writes:
> I have been trying to invent a generalized RegExp for "a number" but
> failed. I believe there exists a RegExp that I need but I cannot find it or
> work it out myself. Please, help.
Checkout perlfaq4:
How do I determine whether a scalar is a
number/whole/integer/float?
HTH,
Ala
------------------------------
Date: Mon, 22 Mar 1999 10:41:57 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: [HELP] How to restrict other sites to link my documents?
Message-Id: <36F68EF5.56C4C214@mail.cor.epa.gov>
Sbin Lin wrote:
> Hi,
> Could anyone tell me how to restrict other sites to
> link my documents (just like images). I want to protect my images
> which would not be retrived directly by other sites.
> I mean the images could just be retrived from the web pages in my site.
> Is it possible? If yse, how can it do that?
I hate to be the one^H^H^Hfirst to tell you, but this is not
a Perl question or a Perl issue. You need to read the docs
for your server, and talk to one of the www newsgroups. Even
if you're writing your code in Perl, this is a web-authoring
problem.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 22 Mar 1999 14:36:18 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Anyone received this message from DeAnne Pearson?
Message-Id: <comdog-ya02408000R2203991436180001@news.panix.com>
i think this might be from a robot. i received this exact message
twice this month. has anyone else received it? if so, i am going
to complain to her company and upstream provider. please respond to
me in private mail.
------
Date: Mon, 22 Mar 1999 13:05:42 -0600
From: DeAnne Pearson <dea@[deleted].com>
To: brian@[deleted].com
Subject: networking
I am contacting you because I understand that you are somewhat a Perl
Guru. I am working with a company here in Austin, Texas that is in need
of a person who is a real CGI and Perl "know- it -all". This person will
have to have a CS degree and would be able to withstand peer reviews of
his technical work. The company is a well known Internet presence and
would offer a good salary with the opportunity to get in on stock
offerings and watch this company take off.
Do you know anyone with these qualifications?
DeAnne
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 22 Mar 1999 10:13:56 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: array question
Message-Id: <36F68864.BD045E27@mail.cor.epa.gov>
Mark P. wrote:
>
> I'm trying to do a match of file extensions listed in an array with an
> uploaded file, but my stuff aint working. Can someone see whats going
> wrong here?
>
> $query -> import_names('Q');
> $file_extension = $Q::file_to_upload-01;
> $file_extension =~ /\.(.*)$/is;
> if ($file_extension) {
> foreach $extension (@extension) {
> if ($file_extension =~ m/$extension/i) {
> $check_extension = 1;
> last;
> }
> }
> }
> else {
> $check_extension = 1;
> }
> if ($check_extension != 1) { &error2; }
We'd like to help. Really. But it's hard when you don't tell us
what your code is *supposed* to do. I can see a few things that
might be related to your problem. One is that your first regex
is greedy. If your file is named my.cool.file.txt the regex
will return 'cool.file.txt' instead of 'txt'. Change the
(.*) to (.*?) . The 's' on the end is probably not needed either.
As for other problems, I can't tell from here.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 22 Mar 1999 19:09:28 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Change password online script.
Message-Id: <7d64h8$js9$4@info2.uah.edu>
In article <7d5h5r$8o9$1@news.news-service.com>,
"Marcel Lemmen" <lemmen@support.nl> writes:
: I'm an ISP and I want my users to change their password online.
: I want to use a Perl CGI script.
: Who can help me with this script?
Lincoln Stein (author of the popular CGI.pm) wrote an excellent article
that appeared in issue 10 of The Perl Journal (Summer 1998) that deals
with precisely the problem you're facing. Its title is "Safely
Empowering Your CGI Scripts", and it appears on pages 31-36.
Greg
--
Nine out of ten men who try Camels prefer women.
------------------------------
Date: Mon, 22 Mar 1999 14:14:28 -0400
From: Terra Landry <terral@cyberplex.com>
Subject: Converting currency
Message-Id: <36F68883.A77E4B63@cyberplex.com>
I want to convert my cost to $0.00 but am not quite sure how to do it..
and I want to convert my time to 0:00
Can anyone help me??
Thanks in advance,
Terra
------------------------------
Date: Mon, 22 Mar 1999 18:44:30 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Converting currency
Message-Id: <icwJ2.526$B95.1258@news.rdc1.on.wave.home.com>
In article <36F68883.A77E4B63@cyberplex.com>,
Terra Landry <terral@cyberplex.com> wrote:
! I want to convert my cost to $0.00 but am not quite sure how to do it..
I'd like my cost to be $0.00 too ... let us know when you
discover this little trick :-)
! and I want to convert my time to 0:00
ok, you're out of time ... next
! Can anyone help me??
the perlfaqs can provide some assistance: specifically, see perlfaq4
for the question 'Does perl have a round function?...'
also, check out 'perldoc -f sprintf'
regards
andrew
------------------------------
Date: Mon, 22 Mar 1999 13:35:53 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Terra Landry <terral@cyberplex.com>
Subject: Re: Converting currency
Message-Id: <36F68D89.4E7E4781@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Terra Landry wrote:
>
> I want to convert my cost to $0.00 but am not quite sure how to do it..
hmm? huh. I want to convert my debt to $0.00 ;^)
> and I want to convert my time to 0:00
I'd rather convert my time to, oh, 7pm Friday. ;^)
How do your questions relate to Perl? Do you have a variable
named "$cost" which you want to print as, say
printf '$%.2f', $cost;
??? As for time... I'll try to "Use the Force."(Tm) to divine
the nature of your problem. (...deep, Yoda-like meditative trance...)
use POSIX qw(strftime);
print strftime "%I:%M:%S %p", localtime;
> Can anyone help me??
>
> Thanks in advance,
> Terra
Jay Glascoe
--
cheese! :-)
------------------------------
Date: Mon, 22 Mar 1999 11:16:34 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Terra Landry <terral@cyberplex.com>
Subject: Re: Converting currency
Message-Id: <36F69712.683FFEC6@atrieva.com>
Terra Landry wrote:
>
> I want to convert my cost to $0.00 but am not quite sure how to do it..
Sell everything you own and live under a bridge. But that's probly not
what you meant.
You need printf() or sprintf(). For all the exciting details on
printf, and other print formating tools, see the perlfunc documentation
that comes with every perl distribution. You might also want to peruse
the format(?) man page, if your system is so equiped.
> and I want to convert my time to 0:00
Same same.
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 22 Mar 1999 19:02:47 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: date in perl under nt
Message-Id: <7d644n$js9$3@info2.uah.edu>
In article <7d5qnn$gti$1@nuss.hannover.sgh-net.de>,
"r|digerD" <pepp@pepp.de> writes:
: working with a little perlscript to print out date and time there is no
: problem with my linux.
: the line:
: $date_command = " /bin/date";
If you end up writing date(1) in Perl, please submit it to PPT. To
learn more about the Perl Power Tools project, visit
<URL:http://language.perl.com/ppt/>
Greg
--
Scotsmen wear kilts because sheep can hear zippers...
------------------------------
Date: Mon, 22 Mar 1999 18:32:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Difficult hex code replacement problem
Message-Id: <36f98c14.2974133@news.skynet.be>
thst@my-dejanews.com wrote:
>I was really surprised about the following problem:
>Assuming that there is a file with the following contents (in hex code):
>...
>20 64 73 64 73 20 67 68
>66 68 6B 0D 0A 1A 20 20
>67 66 64 67 20 68 66 64
>....
>Now I want to replacing this mysterious 1A bytes with a blank (20)
"1A" is a dangerous character on PC systems. It will flag the end of the
file, in text mode. You should have used binmode() on the file. Did you?
Be forewarned that bninmode() will also prevent conversion of CRLF to
"\n", so you'll need to get rid of "\r" manually. For example, using
tr/\r//d;
or set $/ to "\n\r", and chomp().
HTH,
Bart.
------------------------------
Date: Mon, 22 Mar 1999 18:24:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help please - can't open .pl file
Message-Id: <36f68a12.2460420@news.skynet.be>
Mark Austin wrote:
>All auto-installed ok but when I double click on any of the .pl files, the
>Perl scripting screen flashes up and then off again in a split second (you
>can actually sort of see the script is there).
Yes, it works. What you see isPerl running the script, displaying it's
output, and closing the window again. Unfortunately YOU won't be able to
see that printout. :-)
You could keep the script from closing, e.g. by a
END {
print STDOUT "Press <enter>...";
<STDIN>;
}
in your script, but it might be better to just open a MS-DOS window, and
type something like:
perl -w yourscript.pl *.txt
which will print the result in your current MSDOS window, and NOT close
it.
Bart.
------------------------------
Date: Mon, 22 Mar 1999 14:43:49 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Http_referer registers page script is called from
Message-Id: <comdog-ya02408000R2203991443490001@news.panix.com>
In article <7d5s71$rat$1@nnrp1.dejanews.com>, experiment@my-dejanews.com posted:
> I have a script that records info about a webpage vistor. However the
> http_referer evironment varible registers the page I call the script from!
of course! that's the page that called the script!
> The script is called using the <img src= tag with the script outputing an
> invisible image.
>
> Is there a way to stop this and get it to record the referer to the page?
you could pass a parameter through the CGI with server side includes,
but this is such a factured technology that i dare not give you an
example. your server docs should help, though.
not that any of this had anything to do with Perl, but i had to say
that so that the subject of the newsgrop at least appeared in the
message.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 22 Mar 1999 11:39:24 -0600
From: Jie Ma <JIEMA1@email.mot.com>
Subject: install oraperl
Message-Id: <36F6804C.89727054@email.mot.com>
Hi, there,
I'm trying to install oraperl for the first time. I wonder whether I
can get
some help from the experienced.
First of all, I wonder whether oraperl is just the DBD layer or it is
the
combination of DBI and DBD. In the earlier case, I may need to install
DBI in addition. If yes, which version should I choose?
Secondly, I download oraperl from
http://www.metronet.com/1h/perlinfo/scripts/dbase/oraperl/oraperl-v2.4.tar.Z.
That's the only one I can find from web. Currently, the perl on our
system is version
5.002 beta2 with DEBUGGING. I wonder whether it is compatible with
oraperl 2.4. Maybe I should use the most recent DBI and DBD for oracle
instead?
Also, I'm thinking about upgrading our perl from 5.002 to 5.004 (or
5.005?).
Will this effect the answer for the above questions? - Do I need to
upgrade
oraperl as well?
Thirdly, the installation steps. From the Readme with oraperl 2.4, I
realize
I have to customize Makefile first. Then 'make oraperl' -> 'make
test'-> make install. - is it right? I can't locate libocic.a,
osntab.o, libora.a,
also don't have $SRC/usub. In other words, how do I find out whatever
is used to link OCI programs.
Thank you very much for your help. You can send your response directly
to
jiema1@email.mot.com.
Jie
------------------------------
Date: Mon, 22 Mar 1999 13:36:41 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
To: "Raymond C. Jender" <rcj@lucent.com>
Subject: Re: looking for script...
Message-Id: <x3yww0974nb.fsf@tigre.matrox.com>
[posted and CCed]
"Raymond C. Jender" <rcj@lucent.com> writes:
> 1. take an input value (ID number)
>
> 2. search a flatfile for the ID #
> (alternative: search directory for filename=ID#
> and return contents of file. Actually may
> be a preferred method!)
>
> 3. return everything found between
> the current ID and the next ID #.
>
> The file format would be something like this:
>
> 12345: blah blah text blah blah text. more text
> more text.....
> final line of text...
> 32784: text.......
> text, more text....
> more text....
> 55467: text.....
> more text....
> even more text...
Here's a little something:
##### To search for ID# in a flat file
my $id = 12345; # this can come from a web page
my $file = "file.txt"; # or whatever
my $text;
open F, $file or die "Couldn't open $file: $!\n";
1 until ($_ = <F>) =~ /^$id:/;
$text = $_;
while (<F>) {
last if /^\d+:/;
$text .= $_;
}
##### To search for file = ID#
my $id = 12345;
my $text;
open F, $id or die "Can't open $id: $!\n";
{ local $/ = undef; $text = <F> }
This assumes that your files are called "12345" not "12345.ext" .. but
you can easily fix that. In both cases, what you need will be in $text.
HTH,
Ala
------------------------------
Date: Mon, 22 Mar 1999 14:44:18 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: "Raymond C. Jender" <rcj@lucent.com>
Subject: Re: looking for script...
Message-Id: <36F69D92.6EE5CCC0@giss.nasa.gov>
[courtesy copy of post sent to cited author]
"Raymond C. Jender" wrote:
>
> I'm looking for a script that will:
>
> 1. take an input value (ID number)
>
> 2. search a flatfile for the ID #
> (alternative: search directory for filename=ID#
> and return contents of file. Actually may
> be a preferred method!)
>
> 3. return everything found between
> the current ID and the next ID #.
perl -0777 -i.bak -ne '
BEGIN { $id = shift }
m/(:?^|\n)$id: (.*?)(:?\n\d+:|$)/s and print $2;
' 32784 input_file
Jay Glascoe
--
cheese! :o)
------------------------------
Date: Mon, 22 Mar 1999 17:52:30 GMT
From: kmyers@syneractive.com
Subject: Newbie in need of help!!!
Message-Id: <7d600p$ups$1@nnrp1.dejanews.com>
I'm a total Perl newbie who really needs help solving a problem. I've
downloaded a search script from the Matt's script archive site and and
modified it to work on a Windows NT machine. The problem I've having is that
after it searches a directory and returns all matching files it prints the
words "File not found" twice. The search aspect works fine, I just don't
understand why the "File not found message is being printed also. If you can
tell me what the problem is please email me at kmyers@syneractive.com Thank
you.
Here's a copy of the code:
#!/usr/bin/perl
#######################################################################
#######
# Simple Search Version 1.0
#
# Copyright 1996 Matt Wright mattw@worldwidemart.com
#
# Created 12/16/95 Last Modified 12/16/95
#
# Scripts Archive at: http://www.worldwidemart.com/scripts/
#
#######################################################################
#######
# COPYRIGHT NOTICE
#
# Copyright 1996 Matthew M. Wright All Rights Reserved.
#
#
#
# Simple Search may be used and modified free of charge by anyone so
long as #
# this copyright notice and the comments above remain intact. By using
this #
# code you agree to indemnify Matthew M. Wright from any liability that
#
# might arise from it's use.
#
#
#
# Selling the code for this program without prior written consent is
#
# expressly forbidden. In other words, please ask first before you try
and #
# make money off of my program.
#
#
#
# Obtain permission before redistributing this software over the
Internet or #
# in any other medium. In all cases copyright and header must remain
intact.#
#######################################################################
#######
# Define Variables
#
#$basedir = '/mnt/web/guide/worldwidemart/scripts/';
#$baseurl = 'http://worldwidemart.com/scripts/';
#@files = ('*.shtml','demos/links/*.html','demos/guest/*.html');
#$title = "Matt's Script Archive";
#$title_url = 'http://worldwidemart.com/scripts/';
#$search_url =
'http://worldwidemart.com/scripts/demos/search/search.html';
$counter = 0;
$total_returned = 0;
$basedir = 'C:\inetpub\wwwroot\kosa';
$baseurl = 'http://landini/kosa/';
@files = ('*.htm','*.html','*.asp');
$title = "Kosa Web Site";
$title_url = 'search.html';
$search_url = 'http://landini/kosa/search.html';
@directories = ('C:/inetpub/wwwroot/kosa/poly/',
'c:/inetpub/wwwroot/kosa/resins/',
'c:/inetpub/wwwroot/kosa/staple/',
'C:/inetpub/wwwroot/kosa/techfila/',
'C:/inetpub/wwwroot/kosa/textfila/',
'C:/inetpub/wwwroot/kosa/tire/');
@url = ('http://landini/kosa/poly/',
'http://landini/kosa/resins/',
'http://landini/kosa/staple/',
'http://landini/kosa/techfila/',
'http://landini/kosa/textfila/',
'http://landini/kosa/tire/');
# Done
#
#######################################################################
#######
# Parse Form Search Information
&parse_form;
# Get Files To Search Through
&get_files;
# Search the files
&search;
# Print Results of Search
&print_header;
&print_results;
foreach $subscript (@directories)
{#begin foreach
$baseurl = $url[$counter];
$basedir = $subscript;
&get_files;
&search;
&print_results;
$counter = $counter + 1;
}#end foreach
&print_footer;
sub parse_form {
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
}
sub get_files {
chdir($basedir);
foreach $file (@files) {
$ls = `dir $file`;
@ls = split(/\s+/,$ls);
foreach $temp_file (@ls) {
if (-d $file) {
$filename = "$file$temp_file";
if (-T $filename) {
push(@FILES,$filename);
}
}
elsif (-T $temp_file) {
push(@FILES,$temp_file);
}
}
}
}
sub search {
@terms = split(/\s+/, $FORM{'terms'});
foreach $FILE (@FILES) {
open(FILE,"$FILE");
@LINES = <FILE>;
close(FILE);
$string = join(' ',@LINES);
$string =~ s/\n//g;
if ($FORM{'boolean'} eq 'AND') {
foreach $term (@terms) {
if ($FORM{'case'} eq 'Insensitive') {
if (!($string =~ /$term/i)) {
$include{$FILE} = 'no';
last;
}
else {
$include{$FILE} = 'yes';
}
}
elsif ($FORM{'case'} eq 'Sensitive') {
if (!($string =~ /$term/)) {
$include{$FILE} = 'no';
last;
}
else {
$include{$FILE} = 'yes';
}
}
}
}
elsif ($FORM{'boolean'} eq 'OR') {
foreach $term (@terms) {
if ($FORM{'case'} eq 'Insensitive') {
if ($string =~ /$term/i) {
$include{$FILE} = 'yes';
last;
}
else {
$include{$FILE} = 'no';
}
}
elsif ($FORM{'case'} eq 'Sensitive') {
if ($string =~ /$term/) {
$include{$FILE} = 'yes';
last;
}
else {
$include{$FILE} = 'no';
}
}
}
}
if ($string =~ /<title>(.*)<\/title>/i) {
$titles{$FILE} = "$1";
}
else {
$titles{$FILE} = "$FILE";
}
}
}
sub print_header {
print "Content-type: text/html\n\n";
print "<HTML><HEAD>";
print "<BASE HREF='http://landini/kosa/'>";
print "<TITLE>KoSa: Search Results </TITLE>";
print "<SCRIPT language='JavaScript'>";
print "<!--";
print "function OpenView(newin) {";
print "road=window.open(newin,";
print "'console',";
print
"'resizable=no,scrollbars=no,width=201,height=251,top=0,left=0')";
print "}";
print "// -->";
print "</SCRIPT>";
print "</HEAD>";
print "<BODY BGCOLOR='#FFFFFF' ALINK='#000066' VLINK='#006600'
onLoad=\"self.name = 'main'\" TEXT='#000033'>";
print "<LINK REL=STYLESHEET HREF='sheet.css' TYPE='text/css'>";
print "<CENTER>";
print "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='0' WIDTH='600'>";
print "<TR>";
print " <TD WIDTH='600' COLSPAN='7'><A HREF='index.htm'><IMG
SRC='images/logo.gif' WIDTH='183' HEIGHT='71' HSPACE='0' ALIGN='Left'
ALT='KoSa' BORDER='0'></A><IMG SRC='images/topline.gif' WIDTH='266'
HEIGHT='49' HSPACE='0'><A
HREF='javascript:OpenView('console.htm');'><NOSCRIPT><A
href='console.htm' target='console'></NOSCRIPT><IMG
SRC='images/jump.gif' WIDTH='121' HEIGHT='49' BORDER='0' ALT='Jump to a
Business'></A><IMG SRC='images/topline.gif' WIDTH='15' HEIGHT='49'
HSPACE='0'><IMG SRC='images/toprt.gif' WIDTH='15' HEIGHT='49'><A
HREF='who.htm'><IMG src='images/buttons/who.gif' width='68' HEIGHT='22'
BORDER='0' alt='Who is KoSa?'></A><IMG src='images/buttons/sp.gif'
width='14' HEIGHT='22'><A HREF='products.htm'><IMG
src='images/buttons/products.gif' width='43' HEIGHT='22' BORDER='0'
alt='Products'></A><IMG src='images/buttons/sp.gif' width='14'
HEIGHT='22'><A HREF='locate.htm'><IMG src='images/buttons/locate.gif'
width='47' HEIGHT='22' BORDER='0' alt='Locations'></A><IMG
src='images/buttons/sp.gif' width='14' HEIGHT='22'><A
HREF='whatsnew.htm'><IMG src='images/buttons/whatsnew.gif' width='63'
HEIGHT='22' BORDER='0' alt='What's New?'></A><IMG
src='images/buttons/sp.gif' width='14' HEIGHT='22'><A
HREF='contact.htm'><IMG src='images/buttons/contact.gif' width='37'
HEIGHT='22' BORDER='0' alt='Contact'></A><IMG
src='images/buttons/sp.gif' width='14' HEIGHT='22'><A
HREF='search.htm'><IMG src='images/buttons/search.gif' width='33'
HEIGHT='22' BORDER='0' alt='Search'></A><IMG
src='images/buttons/sp.gif' width='14' HEIGHT='22'><A
HREF='index.htm'><IMG SRC='images/buttons/home.gif' WIDTH='27'
HEIGHT='22' BORDER='0' ALT='home'></A><IMG src='images/buttons/sp.gif'
width='15' HEIGHT='22'></TD>";
print "</TR>";
print "<TR>";
print " <TD WIDTH='585' COLSPAN='5'><IMG SRC='images/headtop.gif'
WIDTH='585' HEIGHT='19'></TD>";
print " <TD WIDTH='1'><IMG SRC='images/sp.gif' WIDTH='1'></TD>";
print " <TD WIDTH='14'><IMG SRC='images/headtop.gif' WIDTH='14'
HEIGHT='19'></TD>";
print "</TR>";
print "<TR>";
print " <TD WIDTH='14' ROWSPAN='3' VALIGN='TOP'><IMG
SRC='images/side.jpg' WIDTH='14' HEIGHT='49'></TD>";
print " <TD WIDTH='1' BGCOLOR='#000099' ROWSPAN='2' VALIGN='TOP'><IMG
SRC='images/linetop.gif' WIDTH='1' HEIGHT='21'><BR><IMG
SRC='images/line.gif' WIDTH='1' HEIGHT='76'></TD>";
print " <TD WIDTH='15' ROWSPAN='2' VALIGN='TOP'><IMG
SRC='images/linesp.gif' WIDTH='15' HEIGHT='21'><IMG
SRC='images/headbot.gif' WIDTH='15' HEIGHT='28'></TD>";
print " <TD WIDTH='540' VALIGN='TOP'><IMG
SRC='images/headers/return.gif' WIDTH='122' HEIGHT='21' ALT='Search
Return'><IMG SRC='images/linesp.gif' WIDTH='418' HEIGHT='21'><IMG
SRC='images/headbot.gif' WIDTH='540' HEIGHT='28'></TD>";
print " <TD WIDTH='15' ROWSPAN='2' VALIGN='TOP'><IMG
SRC='images/side.jpg' WIDTH='15' HEIGHT='49'></TD>";
print " <TD WIDTH='1' BGCOLOR='#000099' ROWSPAN='2' VALIGN='TOP'><IMG
SRC='images/wsp.gif' WIDTH='1' HEIGHT='21'><BR><IMG
SRC='images/line.gif' WIDTH='1' HEIGHT='76'></TD>";
print " <TD WIDTH='14' ROWSPAN='3' VALIGN='TOP'><IMG
SRC='images/side.jpg' WIDTH='14' HEIGHT='49'></TD>";
print "</TR>";
print "<TR>";
print " <TD WIDTH='540' VALIGN='Top'><FONT CLASS=body SIZE=2
FACE='Arial, Helvetica, SanSerif'>";
print "Your search for the term <B>@terms</B> returned the following
documents: <P>";
print "<ul type='square'>\n";
}
sub print_results {
foreach $key (keys %include) {
if ($include{$key} eq 'yes') {
print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
$total_returned += 1;
}
}
}
sub print_footer {
print "</ul>\n";
print $total_returned;
print " </FONT><BR><IMG SRC='images/sp.gif' WIDTH='540'
HEIGHT='15'></TD>";
print " </TR>";
print " <TR>";
print " <TD BGCOLOR='#000099' WIDTH='572' COLSPAN='5'><IMG
SRC='images/sp.gif' WIDTH='572' HEIGHT='1'></TD></TR>";
print " <TR>";
print " <TD colspan='7'><TABLE><TR><TD><IMG src='images/sp.gif'
width='30' height='1'><FONT CLASS=copy SIZE=2 FACE='Arial, Helvetica,
SanSerif'>®1999 <A HREF='index.htm'>KoSa</A>. All rights
reserved.</FONT></TD><TD ALIGN='RIGHT'><FONT CLASS=copy SIZE=2
FACE='Arial, Helvetica, SanSerif'>Site created by <A
HREF='http://www.syneractive.com'
TARGET='new'>Syneractive</A>.</FONT><IMG src='images/sp.gif' width='30'
height='1'></TD></TR><TR><TD><IMG SRC='images/sp.gif' WIDTH='300'
HEIGHT='1'></TD><TD><IMG SRC='images/sp.gif' WIDTH='285'
HEIGHT='1'></TD></TR></TABLE></TD>";
print " </TR>";
print "</TABLE>";
print "</CENTER>";
print "</BODY>";
print "</HTML>";
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 22 Mar 1999 11:06:30 -0800
From: "Gabriel Richards" <grichard@uci.edu>
Subject: Odd/Even
Message-Id: <7d6465$r7m@news.service.uci.edu>
Hi,
I'm relatively new to programming and Perl is my first language (besides 1
quarter of high school pascal). So please, be gentle...
I would like to do something like this but don't know how:
while (<FILE>) {
$counter++;
if ($counter = [an odd number]) {do x}
else {do y}
}
I'm looking in my Camel book and can't find a way to test if a number is
even/odd or if a number is an integer as opposed to floating point (then I
could just divide by 2 and test for an integer).
How can I do this (can I do this)? Thanks!
Gabe
------------------------------
Date: Mon, 22 Mar 1999 14:40:09 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Odd/Even
Message-Id: <comdog-ya02408000R2203991440090001@news.panix.com>
In article <7d6465$r7m@news.service.uci.edu>, "Gabriel Richards" <grichard@uci.edu> posted:
> I'm looking in my Camel book and can't find a way to test if a number is
> even/odd or if a number is an integer as opposed to floating point (then I
> could just divide by 2 and test for an integer).
you could use the % operator for modulo arithmetic
$is_odd = $integer % 2 ? 1 : 0;
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 22 Mar 1999 11:47:02 -0800
From: "Gabriel Richards" <grichard@uci.edu>
Subject: Re: Odd/Even
Message-Id: <7d66i6$sdv@news.service.uci.edu>
> you could use the % operator for modulo arithmetic
>
> $is_odd = $integer % 2 ? 1 : 0;
>
Ahhhhh yes, of course! I remember modulo arithmetic from my discrete
mathematics course which I got a C- in! So that's what it's useful for....
Thanks for the quick help!
Gabe
------------------------------
Date: 22 Mar 1999 18:18:52 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Passing @ references into and outof sub procedures.
Message-Id: <7d61ic$ptj@news.service.uci.edu>
In article <7d5roe$8eu$1@ffx2nh3.news.uu.net>,
End User <kimntodd@dontspamus.execpc.com> wrote:
>@DBC;
>@todd = netdom_bdc(DOMAIN);
>foreach $todd(@todd){
> print "BDC for DOMAIN= $todd\n";}
>sub netdom_bdc{
> open(NETDOM, "netdom /domain:$_[0] BDC|");
> while (defined($line=<NETDOM>)){
> if ($line =~ /^BDC/){
> $dc = substr($line,12,15);
> $dc =~ s/\s//;
> push (@BDC, $dc);
> }
> return (\@bdc);
-----------^
You are creating a reference to @bdc. BTW, shouldn't you be
using @BDC? @bdc is not defined anywhere
>It should return a list of machines that are BDC's in my domain. Instead,
>this is what it gives me:
>
>BDC of DOMAIN = ARRAY(0x9b623c)
Get rid of the "\" in the return statement.
--ewh
P.S. You should check your variable names and look into using the
my() operator.
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Mon, 22 Mar 1999 12:29:51 -0600
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: Passing @ references into and outof sub procedures.
Message-Id: <7d626d$b4i$1@galaxy.us.dell.com>
End User wrote in message <7d5roe$8eu$1@ffx2nh3.news.uu.net>...
>Perhaps someone can help me out there.
>
>here is my little snip that isnt working right:
>
>@DBC;
^^^^^ misspelled -- you use BDC below. This declaration of a global
is unneccessary.
>@todd = netdom_bdc(DOMAIN);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you're returning a reference, but
assigning it to an array.
>foreach $todd(@todd){
> print "BDC for DOMAIN= $todd\n";}
>
>sub netdom_bdc{
> open(NETDOM, "netdom /domain:$_[0] BDC|");
> while (defined($line=<NETDOM>)){
> if ($line =~ /^BDC/){
> $dc = substr($line,12,15);
> $dc =~ s/\s//;
> push (@BDC, $dc);
> }
> return (\@bdc);
^^^^^^^ You have to consistent. @BDC and @bdc are two
different variables in perl.
Case is important.
> }
>
>}
>
>It should return a list of machines that are BDC's in my domain. Instead,
>this is what it gives me:
>
>BDC of DOMAIN = ARRAY(0x9b623c)
>
>Why cant I get it to return the list of servers?
Because you're doing several things wrong. Here's a snippet that
illustrates how to return a
reference from a subroutine and use it correctly.
#!/usr/local/bin/perl
#use Sys::Hostname;
#$host = hostname();
#print "$host";
#$var = <STDIN>;
#if ($var =~ /.*S/) {
# $var =~ s/[^S\d]*//g;
# $var =~ s/(\d{8}).*/$1/;
# $var = "${var}S";
#} else {
# $var =~ s/\D*//g;
#}
#
##$var =~ s/^(?:(\d)\D*){7}(\d)[^S\d]*/$1$2/;
##$var =~
s/^(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)[^S\d]/$1$2$3$4$5$6$
7$8/;
#print "$var\n";
$ref = netdom_bdc(DOMAIN);
@todd = @$ref;
foreach $todd (@todd) {
print "BDC for DOMAIN = $todd\n";
}
sub netdom_bdc {
local @bdc; #or "my @bdc;"
$dc = "blue";
push (@bdc, $dc);
$dc = "red";
push (@bdc, $dc);
return (\@bdc);
}
------------------------------
Date: Mon, 22 Mar 1999 14:14:02 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: End User <kimntodd@dontspamus.execpc.com>
Subject: Re: Passing @ references into and outof sub procedures.
Message-Id: <36F6967A.9E9946E7@giss.nasa.gov>
[courtesy copy of post sent to cited author]
End User wrote:
>
> Perhaps someone can help me out there.
>
> here is my little snip that isnt working right:
>
> @DBC;
> @todd = netdom_bdc(DOMAIN);
my $todd_aref = netdom_bdc(DOMAIN);
my @todd = @$todd_aref;
> foreach $todd(@todd){
> print "BDC for DOMAIN= $todd\n";}
> sub netdom_bdc{
> open(NETDOM, "netdom /domain:$_[0] BDC|");
# using a global "@BDC" is a bad idea -- probably
# not what you want at all. So, here we
# initialize "@BDC" and make it local to this subroutine
my @BDC = ();
> while (defined($line=<NETDOM>)){
> if ($line =~ /^BDC/){
> $dc = substr($line,12,15);
> $dc =~ s/\s//;
> push (@BDC, $dc);
> }
> return (\@bdc);
# "BDC" and "bdc" are distinct names in Perl
return \@BDC; # return an array reference
> }
>
> }
Jay Glascoe
--
beep!
------------------------------
Date: Mon, 22 Mar 1999 12:37:46 -0600
From: john xu <jxu@centuple.com>
Subject: perl and SSI
Message-Id: <36F68DFA.39B1FE4D@centuple.com>
All:
I am wrinting perl cgi code and am expecting this program get data from
form and send a shtml back to sender. everything works fine except SSI.
The retuned shtml page has SSI which parse other infomation to this
shtml
file. When it returned a page, I saw SSI don't work. The tags still
there and
seems not evaluate by the browser. I tried using MSIE or NS Navigator
which both just keep SSI tags not being evaluated. I don't know what's
wrong. I am using Apache web sever and shtml pages work just fine if the
page is not returned by cgi code. Somebody would like give me some
suggestion or help?
Here is the part of codes related to the cgi code:
#
sub feedback {
if (defined($FEEDBACK) #Defined somewher as $FEEDBACK =
"thanks.shtml"
&& open(FILE, "<$DOCROOT/$FEEDBACK")) { #$DOCROOT = "htdocs"
undef $/;
$_ = <FILE>; # Read file into $_
close FILE;
s/src=\"images/src=\"\/images/g; #change relative path to
absolute one
s/href=\"/href=\"\//g;
print "Content-type: text/html\n\n" . "$_";
return;
}
# Could not open HTML file! Send a generic form.
print <<EOF
Thanks for completing our form.
EOF ;
}
Please reply to jxu@centuple.com so that I won't miss your mail.
----------------------------------------------
John
jxu@centuple.com
------------------------------
Date: Mon, 22 Mar 1999 19:24:32 GMT
From: timespinner@my-dejanews.com
Subject: Perl passing arguements to a Web Page
Message-Id: <7d65d3$3tu$1@nnrp1.dejanews.com>
I know a web page passes environment variables to a Perl script, but is it
possible to do the reverse? Can you have a situation where:
Page_A is a form and when submitted executes script Perl_A Perl_A manipulates
data then sets environment variables $var_a and $var_b then redirects to
Page_B which is a form which contains variables $var_a and $var_b?
Basically, is it possible to return an HTML page that is:
1) Not included in the perl script
-AND-
2) Has fields that can be set to certain values by the perl script
Thanks,
-TS
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 22 Mar 1999 19:31:32 GMT
From: timespinner@my-dejanews.com
Subject: Perl returning arguements to a Web Page
Message-Id: <7d65qk$4cr$1@nnrp1.dejanews.com>
Is it possible to have a web page [PAGE_A] call a perl script, and then have
the perl script manipulate the data and then return a web page [PAGE_B] to
the user and have variables in PAGE_B set to values by the perl script
without having PAGE_B coded into the Perl Script itself?
Thanks,
-TS
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 22 Mar 1999 15:00:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl returning arguements to a Web Page
Message-Id: <comdog-ya02408000R2203991500390001@news.panix.com>
In article <7d65qk$4cr$1@nnrp1.dejanews.com>, timespinner@my-dejanews.com posted:
> Is it possible to have a web page [PAGE_A] call a perl script, and then have
> the perl script manipulate the data and then return a web page [PAGE_B] to
> the user and have variables in PAGE_B set to values by the perl script
> without having PAGE_B coded into the Perl Script itself?
[there's no need to post the same message under different subjects]
this isn't sometime unique to Perl, so you would be better off in
something like comp.infosystems.www.authoring.cgi. however, it sounds
like you are probably going down the wrong road for whatever problem
you are trying to solve.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 22 Mar 1999 14:38:32 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl with SSI
Message-Id: <comdog-ya02408000R2203991438320001@news.panix.com>
In article <36F66EE0.CF1ACF04@centuple.com>, john xu <jxu@centuple.com> posted:
> The retuned shtml page has SSI which parse other infomation to this
> shtml
> file. When it returned a page, I saw SSI don't work. The tags still
> there and
> seems not evaluate by the browser. I tried using MSIE or NS Navigator
> which both just keep SSI tags not being evaluated.
this is a server problem. contact your local web admin for details.
usenet cannot help you because it is a local configuration issue.
this has nothing to do with Perl.
and you don't need to post the same message under different subject
lines unless you want twice the hassle.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 22 Mar 1999 10:30:32 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: removing ASCII chars < 32
Message-Id: <36F68C48.9B0A7192@mail.cor.epa.gov>
Wayne Keenan wrote:
>
> Thanks, but..
>
> Bart Lateur wrote:
>
> >
> > $string =~ s/\000-\037//d;
> >
>
> {
> print "Sending: ".$line;
> chomp($line);
> $port->send($line."\r\n");
> $text=$port->clear();
> $text =~ s/\000-\037//d ; #strip buf of chars < 32
> }
> I get this error:
>
> Bareword found where operator expected at main.pl line 62, near
> "s/\000-\037//d"
> Unquoted string "d" may clash with future reserved word at main.pl line
> 62.
> syntax error at main.pl line 62, near "s/\000-\037//d "
> Execution of main.pl aborted due to compilation errors.
Yep. 'd' is not a legal option for s/// . But Bart knows that
better than I do. He probably meant a 'g' on the end:
s/\000-\037//g
to repeat the substitution throughout the scalar $text .
> Another point:
>
> I could do 3 substitutions (to avoid the \t & \n) but is there a shorter
> way?
> [snip of blank lines]
> >
> > $string =~ tr/\t\n / /s;
This is about as short as you're going to get [unless you replace
the 'tr' with 'y']. tr here takes all your tabs and newlines and
spaces and replaces consecutive stretches of same with a single
space.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 22 Mar 1999 18:26:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: removing ASCII chars < 32
Message-Id: <36f78b38.2754378@news.skynet.be>
Wayne Keenan wrote:
>I get this error:
>
>Bareword found where operator expected at main.pl line 62, near
>"s/\000-\037//d"
>Unquoted string "d" may clash with future reserved word at main.pl line
>62.
Argh! MY BAD! It should have been:
tr/\000-\037//d;
Bart.
------------------------------
Date: Mon, 22 Mar 1999 18:28:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: removing ASCII chars < 32
Message-Id: <36f88b9c.2854397@news.skynet.be>
Allan M. Due wrote:
>Hmm, shouldn't the above use a char class? And shouldn't that be a g
>instead of a d?
>
>$string =~ s/[\000-\037]//g;
Good thinking. Yours will work. But I expect tr///d to be quite a bit
faster. I could be wrong. :-)
Bart.
------------------------------
Date: Mon, 22 Mar 1999 13:06:31 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: removing ASCII chars < 32
Message-Id: <x3yyakp761k.fsf@tigre.matrox.com>
bart.lateur@skynet.be (Bart Lateur) writes:
> $string =~ s/\000-\037//d;
TYPO. s/// has no 'd' modifier. I believe you meant:
$string =~ s/\000-\037//g;
Ala
------------------------------
Date: Mon, 22 Mar 1999 10:42:35 -0800
From: "William P." <spark@alertcom.com>
Subject: Script to download a file from https site
Message-Id: <36F68F1A.4F19AFE@alertcom.com>
Does anybody have a script that downloads a text file from https site? I
have a script that downloads file from ftp site from NT server but now I
have to download a file from https site for security reason.
Any help on this would be really appreciated.
------------------------------
Date: Mon, 22 Mar 1999 14:40:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Script to download a file from https site
Message-Id: <comdog-ya02408000R2203991440390001@news.panix.com>
In article <36F68F1A.4F19AFE@alertcom.com>, "William P." <spark@alertcom.com> posted:
> Does anybody have a script that downloads a text file from https site? I
> have a script that downloads file from ftp site from NT server but now I
> have to download a file from https site for security reason.
see the LWP family of module.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 22 Mar 1999 20:07:09 +0100
From: karrer@iis.ee.ethz.ch (Andreas Karrer)
Subject: Re: Sending/recieving scsi commands - DLT on Solaris
Message-Id: <slrn7fd56t.fo.karrer@kuru.ee.ethz.ch>
In article <36F33253.D3C9C7BA@interaccess.com>, bobn wrote:
>I'm trying to retrieve information from a DLT drive (not the tape in the
>drive, but registers/pages inside the controller) connected to a Sun Ultra-2
>box running Solaris 2.5.1. These pages have information regarding compression
>ratios, error logs, etc.
>
>Sun states there is no utility to do this that they know of. Quantum has one,
>but i only runs on DOS (barf).
>
>I have doc from Quantum (who actually makes the tape drive) giving frame
>formats for various inquiry and response frames.
I doubt that this (accessing non-standard SCSI commands of non-standard
SCSI devices) would be possible on Solaris in a simple way with Perl
or some other Unix user space utility.
The Solaris "Writing Device Drivers" manual
(http://docs.sun.com/ab2/coll.45.6/DRIVER/@Ab2TocView)
contains a chapter about an example SCSI driver and a simple test
program called "sstest". This allows access to the complete scsi
command structures. Using this involves compiling and installing a
driver; you should be or make yourself familiar with the way loadable
drivers are installed on Solaris.
The source code for the "sst" example driver is available from
ftp://ftp.free.net/...
.../systems/sun/packages/Solaris.2.3/solaris2_sample_drivers.tar.gz
- Andi
------------------------------
Date: Mon, 22 Mar 1999 10:47:08 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <36F6902C.DE72EA95@mail.cor.epa.gov>
Greg Bacon wrote:
> [snip]
> Top 10 Threads by Volume
> ========================
>
> (kb) (kb) (kb) (kb)
> Volume ( hdr/ body/ orig) Posts Subject
> -------------------------- ----- -------
>
> 142.8 ( 71.7/ 70.7/ 34.9) 51 The truth about the Pentium III chip and ID --- **boycott info**
> 30.0 ( 11.2/ 16.5/ 10.4) 16 Need Faster Approach
> 25.5 ( 13.9/ 9.7/ 5.0) 17 Variables in QUERY_STRING
> 22.9 ( 6.7/ 15.3/ 8.1) 8 does perl discourage obfuscated code? (was Re: Perl evangelism)
> 21.9 ( 8.3/ 12.5/ 7.8) 11 Need a one liner...
^^^^^^^^^^^
Hmmm. Does anyone else feel the irony implicit here?
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 22 Mar 1999 19:10:58 GMT
From: scott@sboss.net
Subject: UNIX --> WinNT --> Excell Spreadsheet via OLE
Message-Id: <7d64jo$3a5$1@nnrp1.dejanews.com>
Hello All,
I run an almost pure linux shop (with a lot of perl workings). I am getting
ready to have to generate automated reports in Excelspreadsheet format. I
need to put the data there that is gernerated on one (or more) of the linux
boxes. I have not been able to automatically generate (or modify) Excell
spreadsheets on a Linux box. So, I was thinking of putting up a WinNT server
to generate the spreadsheats (or word documents) automatically via input from
the Linux box. I was wondering if anyone has tried this or knows how to do
it? see diagram below.
+-----+ +------+
| |-----[RPC??]--->| | +-------+
|Linux| |Win NT|----[OLE??]-->|Excell |
| | | | |or Word|
+-----+ +------+ +-------+
Thanks and good luck,
Scott
Scott Boss
C{O,F,T,O}O
sboss dot net
Atlanta Perl Mongers Fearless Leader
website: http://atlanta.pm.org
community: http://www.dejanews.com/~apm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Mar 1999 18:13:35 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Weird $_ behavior
Message-Id: <7d618f$pnl@news.service.uci.edu>
In article <oSuJ2.369$Yk5.75577@news.shore.net>,
Scratchie <upsetter@ziplink.net> wrote:
>However, when I try to use the "real" data, something strange happens. The
>subroutine to convert a file to a hash is pretty straightforward:
>sub File2Hash2 {
> my ($input) = shift @_;
> open (FILE,$input) or die ("Could not open $input: $!");
>
> my %hash;
> my ($key, $value);
Put a "local($_);" here.
> while (<FILE>) {
> chomp;
> # assumes two-field layout
> ($key,$value) = split(/\t/);
> $hash{$key} = $value;
> }
> close FILE;
> return %hash;
>}
Remember, $_ is a one of the special global variables. You have to
be careful when you are using it within foreach loops since $_
will become an alias to your array values (if applicable). If you
change the value of $_, you change the values in the array. This
is applicable even across subroutine calls.
It is good practice to use local($_) in subroutines that make
use of $_ to protect against potential data clobbering.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
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 5200
**************************************