[11609] in Perl-Users-Digest
Perl-Users Digest, Issue: 5209 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 23 18:07:21 1999
Date: Tue, 23 Mar 99 15:00:19 -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 Tue, 23 Mar 1999 Volume: 8 Number: 5209
Today's topics:
Re: << string definer (Tad McClellan)
Re: Bad Byte Count <aqumsieh@matrox.com>
C function in Perl <xum@psi.com>
checking for socket number free before bind <kramer@techne.ca>
Re: cookie help <revjack@radix.net>
ENV in ie4 gorgano@my-dejanews.com
Environtmental Variables In IE4 gorgano@my-dejanews.com
Handling white space in path <chou0002@algonquinc.on.ca>
Re: How do variable substitution on a string twice? <aqumsieh@matrox.com>
legacy question <messicci@swol.de>
Re: legacy question <cassell@mail.cor.epa.gov>
Re: legacy question <All@n.due.net>
newbie question <erpeng@cs.auc.dk>
Re: newbie question <jglascoe@giss.nasa.gov>
Re: newbie question <cassell@mail.cor.epa.gov>
Newbie Trying to install DateManip module on NT4.0 <yyigiyi@ghjgkg.com>
Re: Newbie Trying to install DateManip module on NT4.0 <cassell@mail.cor.epa.gov>
Re: Passing parameters (CGI) (brian d foy)
Re: Passing parameters (CGI) (brian d foy)
rookie: "if" unexpected results chadw7799@my-dejanews.com
Re: rookie: "if" unexpected results <jglascoe@giss.nasa.gov>
Re: rookie: "if" unexpected results (Steve Grantz)
Re: rookie: "if" unexpected results (Steve Grantz)
Re: rookie: "if" unexpected results (Larry Rosler)
Re: rookie: "if" unexpected results <paladin@uvic.ca>
Re: Sending/recieving scsi commands - DLT on Solaris <ty@cnr.colostate.edu>
Re: Weird Perl problem (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 23 Mar 1999 10:05:21 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: << string definer
Message-Id: <hja8d7.2s1.ln@magna.metronet.com>
Timothy Larson (larsot2@krypton.mankato.msus.edu) wrote:
: In _Teach Yourself Perl in 21 Days_ I found a neat use of << to define
: multiline strings.
These are called "here documents". They are borrowed from
shell programming.
: OK, the book is an old one, so I was thinking maybe this use of
: << has been dropped. Does anyone know?
Yep, it is still there.
: I haven't found a mention of it
: so far.
Do a word search for "here-doc" in the perldata.pod and
all will be revealed.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 23 Mar 1999 14:12:11 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Bad Byte Count
Message-Id: <x3ylngo6mwo.fsf@tigre.matrox.com>
bryan.c.spann@nationsbank.com writes:
> THE PROBLEM: we have a script that goes out and grabs a snapshot of the
> priv.edb and pub.edb files that are in the exchange server directory, we are
> trying to find out how much space is free and how much is used by employee's
> public folders, the only problem is that if the number it returns is 9 digits
> or above it will give us a skewed answer. For example the number is either
> completely wrong or there is a negative sign in front of it.
That's probably because Perl's scalars aren't big enough to hold a
number this big. It depends on your systems architecture, but scalar
values are only guaranteed to be big enough to hold a pointer. That's
about as much as I know :-)
> THE CODE:
>
> open (cfgfile,"cfg.txt");
You should always check to see if your open() succeeded or not:
open cfgfile, "cfg.txt" or die "$!\n";
btw, it is better to follow the convention that filehandles be
capitalized.
> $sername = <cfgfile>;
> open ( outfile,">output.txt");
again, it is advisable to check the return value of your open().
> printf outfile ("ServerName\tPriv\tPub\n");
> while($sername)
This will probably loop indefinitely. $sername is the first line in
"cfg.txt" (which you read 3 lines before). I believe you meant to loop
through each line in "cfg.txt" .. this does NOT do that. What you want
is:
while (defined($sername = <cfgfile>))
and get rid of the '$sername = <cfgfile>;' line above because it
discards the first line (but, maybe you want that .. I don't know).
> {
>
> $sername =~ s/\n//g;
This is better written as:
chomp $sername;
unless you have modified $/.
> scalar($privpath) = @filearr;
The above line shouldn't even compile. Are you sure you're script runs
without any errors?? Did you cut and paste?
What is the above line trying to do anyway? $privpath is already and a
scalar, and you don't need to make it one.
> $privsize = -s $privpath;
> $privsize = scalar($privsize);
Again, $privsize is already a scalar ('-s $file' returns a
number. i.e. a scalar) and you don't need to make it one.
> $pubsize = -s $pubpath;
>
> printf ("$privpath\n");
> printf ("%s\n",$privsize);
> printf ("%s\n",$privsize);
> printf outfile ("%s\t%s\t%s\n",$sername,$privsize,$pubsize);
> $sername = <cfgfile>;
>
> }
Ok .. your loop won't go indefinitely. I see what you're doing. It's a
strange way to do it, but it works. One warning though if $sername has
the value 0 or "" (the empty string), the condition of the while loop
will be false and it will not execute. That shouldn't occur though
since you chomp() inside the loop. Anyway, I suggest you change it to:
while (defined $sername)
> If anyone can figure out this truncating problem I would worship you as a PERL
> GOD!
Maybe you'll need to look in the Math::BigInt module.
HTH,
Ala
------------------------------
Date: Tue, 23 Mar 1999 22:25:29 GMT
From: "yue xu" <xum@psi.com>
Subject: C function in Perl
Message-Id: <txUJ2.41$Vq.1398171@usenet1.interramp.com>
Does anyone know how to integrate a C function into
Perl? i.e. if I have a function doing shell sort, how can
I make it available in PERL (not mean make it a executable
and do system)?
------------------------------
Date: Tue, 23 Mar 1999 17:27:21 -0500
From: "Bryan M. Kramer" <kramer@techne.ca>
Subject: checking for socket number free before bind
Message-Id: <36F81549.29858AAF@techne.ca>
Is there some way of checking whether a port number is in use
without actually creating a socket and binding?
My code has the following
sub startServer
{
my $port = shift;
my $proto = getprotobyname('tcp');
socket(Server, PF_INET, SOCK_STREAM, $proto)
|| errorExit "socket: $!";
setsockopt(Server, SOL_SOCKET, SO_REUSEADDR, pack("l", 1))
|| errorExit "setsockopt: $!";
bind(Server, sockaddr_in($port, INADDR_ANY))
|| errorExit "bind $port: $!";
listen(Server,SOMAXCONN);
$SIG{CHLD} = \&REAPER;
$server = 1;
}
but I'd like to have something before entering this program that tests
if the port number is available since two or more programs need to
agree on a port number (selected from a pool of port numbers assigned
to this set of systems).
Thanks
------------------------------
Date: 23 Mar 1999 21:13:30 GMT
From: Hank Snatch <revjack@radix.net>
Subject: Re: cookie help
Message-Id: <7d905q$evj$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
dan explains it all:
:i want to save $user to a cookie, can anyone help me out? thanks a lot
$cookie = $user;
--
/~\ Christianson oxen barefaced sweatshirt loot lustrous carriage G
C oo capacity proscenium sir lectionary yardstick annum Dunbar dream
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://3509641275/~revjack 03/23/99 16:14:08 revjack@radix.net
------------------------------
Date: Tue, 23 Mar 1999 22:41:50 GMT
From: gorgano@my-dejanews.com
Subject: ENV in ie4
Message-Id: <7d95bc$mv2$1@nnrp1.dejanews.com>
I'm trying to get $ENV{HTTP_REFERER} from IE4. However, i can not use a
standard link to click on when i load the page. I need to use something like
a meta refresh or location="foo.htm" to do this. However, when ever i use
something like this IE won't pass the HTTP_REFERER variable which i really
need for security reasons. If any one has any ideas as to how to fix this I
would REALLY appreciate it! Thanks for your help.
Jason Hurst
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 23 Mar 1999 22:40:08 GMT
From: gorgano@my-dejanews.com
Subject: Environtmental Variables In IE4
Message-Id: <7d9586$mm4$1@nnrp1.dejanews.com>
I'm trying to get $ENV{HTTP_REFERER} from IE4. However, i can not use a
standard link to click on when i load the page. I need to use something like
a meta refresh or location="foo.htm" to do this. However, when ever i use
something like this IE won't pass the HTTP_REFERER variable which i really
need for security reasons. If any one has any ideas as to how to fix this I
would REALLY appreciate it! Thanks for your help.
Jason Hurst
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 23 Mar 1999 17:55:13 -0500
From: Michael Choueiry <chou0002@algonquinc.on.ca>
Subject: Handling white space in path
Message-Id: <36F81BD1.57AC457A@algonquinc.on.ca>
Hi all,
Please check this little script below and if you would tell me how I
can let it work !
# Purpose
# Lists all the files in a specified directory.
my $directory = "c:\\Program Files\\Windows NT\\Pinball\\*";
while (glob("$directory"))
{
print "File: $_\n";
}
As you can see, if the variable directory is given a path with no
spaces, it works just fine but if like this example, it wouldn't !
I used GetOpt::Long but didn't work either !
Any suggestion would be appreciated !
Thank you very much.
Michael.
------------------------------
Date: Tue, 23 Mar 1999 14:14:39 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: How do variable substitution on a string twice?
Message-Id: <x3yk8w86msg.fsf@tigre.matrox.com>
Mikael Uvebrandt <d97-muv@d.kthKEiN_SPAM.se> writes:
> I have a line like this:
> s/$searchstr/$replstr/g
>
> Now, Perl will treat $replstr as double-quoted and do variable
> substitution on it. But suppose $replstr="$1" because I want to do
> something with the regex in $searchstr. What I want is for Perl to
> recognize $1 as a reference to the regex in $searchstr, instead of
> using '$1' literally as the replace string. Is there any way of
> tricking Perl into doing this?
look into the /e modifier for s///. It basically eval()s the
replacement string as a Perl command. You can have more than one /e
modifier if you so wish.
> I must have the search and replace strings in variables, because I
> don't know beforehand what they will be when the actual
> substitution is made.
In this case, using a hash that maps variable names to values is
almost always a Better Thing to do. Look into that.
HTH,
Ala
------------------------------
Date: Tue, 23 Mar 1999 22:34:51 +0100
From: "Frank" <messicci@swol.de>
Subject: legacy question
Message-Id: <36f815ce@news.swol.de>
May I download Perl and some libs to use it in our company ?
Frank
------------------------------
Date: Tue, 23 Mar 1999 14:25:48 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: legacy question
Message-Id: <36F814EC.93AFF8C2@mail.cor.epa.gov>
Frank wrote:
> May I download Perl and some libs to use it in our company ?
> Frank
Umm, Frank, if your question is: "Is Perl and all of its library
free for use by any for-profit company?" Yes.
Does it have a nice licensing agreement? Yes. The best one around.
Can you write effective, maintainable code in it? Yes.
Does it work well with other programs? A big yes.
Does it have anything to do with your subject line? Beats me.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 23 Mar 1999 22:29:50 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: legacy question
Message-Id: <yBUJ2.6618$DM5.2796@news.rdc1.ct.home.com>
Frank <messicci@swol.de> wrote in message news:36f815ce@news.swol.de...
: May I download Perl and some libs to use it in our company ?
: Frank
Yes you may, and thanks for asking for permission first <g>. Perl is free
for all, just get thee to www.cpan.org and check for the appropriate flavor.
Your two main choices are binary distributions or source code, grab which
ever you prefer. If you are one of the unfortunate living in a Window
world, wonder on over to www.activestate.com where they have a nicely
bundled Perl port for windows. Have fun and when you run into trouble come
back and ask your Perl related questions here. Welcome aboard!
AmD
------------------------------
Date: Tue, 23 Mar 1999 21:46:20 GMT
From: Chen Li <erpeng@cs.auc.dk>
Subject: newbie question
Message-Id: <36F80B85.B4C9D458@cs.auc.dk>
Dear all:
How to append a line to a file? Thanks a lot.
Regards,
Chen
------------------------------
Date: Tue, 23 Mar 1999 17:13:00 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Chen Li <erpeng@cs.auc.dk>
Subject: Re: newbie question
Message-Id: <36F811EC.20593141@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Chen Li wrote:
>
> How to append a line to a file? Thanks a lot.
use IO::File;
IO::File->new(">> $file_name")->print($your_line_here);
Jay Glascoe
--
"Just say 'Narf!'."
--Pinky
------------------------------
Date: Tue, 23 Mar 1999 14:34:28 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: newbie question
Message-Id: <36F816F4.670B3838@mail.cor.epa.gov>
Chen Li wrote:
> Dear all:
> How to append a line to a file? Thanks a lot.
>
> Regards,
> Chen
This is completely covered in the FAQ. With example code.
Try these commands:
perldoc perlfaq5 # if you have a modern version of Perl
perldoc -q append # if you have Perl 5.005
or read the html docs if you have ActivePerl and prefer your
browser
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 23 Mar 1999 16:42:15 -0800
From: "yututiiyiyi" <yyigiyi@ghjgkg.com>
Subject: Newbie Trying to install DateManip module on NT4.0
Message-Id: <7d91il$9nn$1@camel15.mindspring.com>
Hello,
I am trying to install an available date manipulation module on
my NT 4.0 system. Here are the steps I followed.
1) Downloaded the file from CPAN: DateManip_version.tar.gz
2) Tried uncompressing it...using WinZip 7.0.
Winzip does notuncompress this file,
....struck at step 3.
Please help!
Ron
------------------------------
Date: Tue, 23 Mar 1999 14:28:49 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Newbie Trying to install DateManip module on NT4.0
Message-Id: <36F815A1.542F31ED@mail.cor.epa.gov>
yututiiyiyi wrote:
>
> Hello,
> I am trying to install an available date manipulation module on
> my NT 4.0 system. Here are the steps I followed.
>
> 1) Downloaded the file from CPAN: DateManip_version.tar.gz
> 2) Tried uncompressing it...using WinZip 7.0.
> Winzip does notuncompress this file,
>
> ....struck at step 3.
>
> Please help!
>
> Ron
You need a gzip program. Go to your browser and search for
Win32 versions of both tar and gunzip. Undoubtedly, someone
more organized than I will post to this thread with a URL too.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 23 Mar 1999 16:41:34 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Passing parameters (CGI)
Message-Id: <comdog-ya02408000R2303991641340001@news.panix.com>
In article <slrn7ffshr.243.robobob@blech.mindwell.com>, jason@mediabang.com posted:
> On Tue, 23 Mar 1999 19:37:34 GMT, Mike Wilson <wmwilson1@go.com> wrote:
> Change:
> ><FORM METHOD="POST" ACTION="/cgi-bin/script.pl?table=this_table">
>
> To:
> <FORM METHOD="POST" ACTION="/cgi-bin/script.pl">
> <INPUT TYPE=HIDDEN NAME="table" VALUE="this_table">
this looks suspiciously like a kludge to get around a broken
implementation of the CGI standard. CGI.pm works fine with the
first example, assuming you aren't using a stupid serve.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 23 Mar 1999 16:48:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Passing parameters (CGI)
Message-Id: <comdog-ya02408000R2303991648590001@news.panix.com>
In article <7d8qhu$ch3$1@nnrp1.dejanews.com>, Mike Wilson <wmwilson1@go.com> posted:
> I was wondering if someone could help me with a little perl problem I'm
> having. I currently have a perl script which creates a form and takes the
> parameter table=tablename. When I pass this form to the perl script which
> parses the info and submits it to the database it seems as if it doesn't like
> my table reference and therefore fails. I'm doing something like
>
> in the form script..
> <FORM METHOD="POST" ACTION="/cgi-bin/script.pl?table=this_table">
>
> my query = new CGI;
> my $table = query->param("table")
do you get anything for the 'table' value? CGI.pm handles this -
there are even some comments in the code about it.
oh, wait a minute, look for something like this:
# Some people want to have their cake and eat it too!
# Uncomment this line to have the contents of the query string
# APPENDED to the POST data.
# $query_string .= (length($query_string) ? '&' : '') . $ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'};
you need to uncomment that line, as i have :) for 2.42, that's line
398.
personally, i think this should be the default behaviour. otherwise
you can get to the query string through the query_string() method.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 23 Mar 1999 21:11:41 GMT
From: chadw7799@my-dejanews.com
Subject: rookie: "if" unexpected results
Message-Id: <7d9022$hvq$1@nnrp1.dejanews.com>
Quick Perl question:
The following snippit is supposed to print only if the two item match.
Instead the innermost if statement prints every time it compares. What am I
missing?
TIA
Thanks,
a rookie perler
Chad W.
sub search_database{
# my $search_for = $_[0];
open(DB, $database) or die "Error opening file: $!\n";
while(<DB>){
($empty,$zip,$id,$empty,$empty,$sal,$name,$email)=split(/\|/,$_);
chomp ($email);
foreach $e_m (@email_list) {
chomp ($e_m);
if ("$email" == "$e_m") {
print "$email==$e_m\n";
}
}
}
close (DB);
} # End of subroutine.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 23 Mar 1999 16:44:58 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: chadw7799@my-dejanews.com
Subject: Re: rookie: "if" unexpected results
Message-Id: <36F80B5A.C17128FB@giss.nasa.gov>
[courtesy copy of post sent to cited author]
chadw7799@my-dejanews.com wrote:
>
> Quick Perl question:
<snip>
> if ("$email" == "$e_m") {
two problems here:
1) use 'eq' instead of '==' to compare two strings
2) don't put unnecessary quotes around scalar variables
print "'$email' eq '$e_m'\n" if $email eq $e_m;
Jay Glascoe
--
"Yes, you can think of almost everything as a function,
but this may upset your wife."
-- Larry Wall
"Narf!"
-- Pinky
------------------------------
Date: Tue, 23 Mar 1999 21:46:38 GMT
From: sgrantz@visi.com (Steve Grantz)
Subject: Re: rookie: "if" unexpected results
Message-Id: <2ZTJ2.1089$rP1.48478@ptah.visi.com>
chadw7799@my-dejanews.com wrote:
: Quick Perl question:
:
: The following snippit is supposed to print only if the two item match.
: Instead the innermost if statement prints every time it compares. What am I
: missing?
You're missin' the camel, baby!
: if ("$email" == "$e_m") {
: print "$email==$e_m\n";
: }
Since you have the double quotes around the scalars, I am guessing
you are trying to 'cast' the scalars as strings. But then you need the
string compare eq rather than ==
"$email" eq "$e_m"
In which case, perl already knows to do this as a string compare, and
the double quote just waste time by forcing an interpolation.
if ($email eq $e_m) {
print "$email eq $e_m\n";
}
HTH,
SG
--
More of Steve Grantz's Blather at 2 * McQ != McQ
http://www.visi.com/~sgrantz 0.5 * McQ == McQ
------------------------------
Date: Tue, 23 Mar 1999 22:02:22 GMT
From: sgrantz@visi.com (Steve Grantz)
Subject: Re: rookie: "if" unexpected results
Message-Id: <ObUJ2.1097$rP1.53650@ptah.visi.com>
chadw7799@my-dejanews.com wrote:
: The following snippit is supposed to print only if the two item match.
: Instead the innermost if statement prints every time it compares. What am I
: missing?
{snip]
: if ("$email" == "$e_m") {
: print "$email==$e_m\n";
: }
By the way, perl evaluates non-numeric strings as 0 in numeric contexts.
Hence the numeric equality each time in your particular example.
--
More of Steve Grantz's Blather at 2 * McQ != McQ
http://www.visi.com/~sgrantz 0.5 * McQ == McQ
------------------------------
Date: Tue, 23 Mar 1999 14:03:46 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: rookie: "if" unexpected results
Message-Id: <MPG.1161af9c756c09069897ad@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7d9022$hvq$1@nnrp1.dejanews.com> on Tue, 23 Mar 1999
21:11:41 GMT, chadw7799@my-dejanews.com <chadw7799@my-dejanews.com>
says...
> The following snippit is supposed to print only if the two item match.
> Instead the innermost if statement prints every time it compares. What am I
> missing?
...
> foreach $e_m (@email_list) {
> chomp ($e_m);
I don't know this array was made, but does each member really have a
new-line character at the end that you want to remove?
> if ("$email" == "$e_m") {
To compare strings, you need to use the 'eq' operator. Also, the
double-quotes around the variable names are superfluous and misleading.
Now, despite all that, this is not the right approach to solving this
problem. You are searching the entire array for every line of the input
file.
The right approach is described in perlfaq4: "How can I tell whether a
list or array contains a certain element?" If you are not yet familiar
with hashes, read about them in perldata. You will still be a newbie,
but one very important step higher on the ladder.
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 23 Mar 1999 14:29:35 -0800
From: Draco Paladin <paladin@uvic.ca>
To: chadw7799@my-dejanews.com
Subject: Re: rookie: "if" unexpected results
Message-Id: <Pine.A41.4.05.9903231426430.72250-100000@unix4.UVic.CA>
On Tue, 23 Mar 1999 chadw7799@my-dejanews.com wrote:
[snip]
[posted and cc'ed]
> foreach $e_m (@email_list) {
> chomp ($e_m);
>
> if ("$email" == "$e_m") {
^^^
== is the numeric comparison operator. you need to use the string
comparison operator 'eq' instead.
Read perldoc perlop for more information.
> print "$email==$e_m\n";
> }
> }
--
Mother is the name for GOD on the lips and
hearts of all children. - Eric Draven
------------------------------
Date: Tue, 23 Mar 1999 14:29:59 -0700
From: "Ty! Boyack" <ty@cnr.colostate.edu>
To: bobn <bobn@interaccess.com>
Subject: Re: Sending/recieving scsi commands - DLT on Solaris
Message-Id: <36F807D7.CFE61CE1@cnr.colostate.edu>
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.
Take a look at the SCG drivers that come with CDRECORD
(http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html)
They provide a user level SCSI library. It's definatly geared
towards C, but it may be possible to adapt it to perl. You
may want to grab the file scgskeleton.c which has some basic
coding examples. One nice thing about this library is it's
attempt to be cross unix-platform.
I've been needing to do a similare operation on a DLT library ---
if you get something working, would you pass it along? I'll
be glad to do the same if you want it.
Of course, Casper's recommendation of USCSI ioctl's sounds easier -
anyone have pointers to more information on that topic?
-Ty!
--
|==========================||======================================|
| Ty! Boyack || Colorado State University |
| Unix Services Manager || College of Natural Resources |
| ty@cnr.colostate.edu || A105B, Advanced Technology Lab, NESB |
| (970) 491-4966 || |
|==========================||======================================|
------------------------------
Date: 23 Mar 1999 22:02:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Weird Perl problem
Message-Id: <7d931h$pcl$3@client2.news.psi.net>
Kavian [SKY:1P12:EXCH] (kavian@americasm01.nt.com) wrote on MMXXX
September MCMXCIII in <URL:news:7d8pg9$4bs$1@bmerhc5e.ca.nortel.com>:
||
||
|| Abigail <abigail@fnx.com> wrote in message
|| news:<7d48bc$nou$3@client2.news.psi.net>...
|| > Kavian Moradhassel (kavian@nortelnetworks.com) wrote on MMXXVIII
|| > September MCMXCIII in <URL:news:7d3r26$eu2$1@bmerhc5e.ca.nortel.com>:
|| > __
|| > __ The details: The script is a five-line driver script using a Perl
|| module
|| > __ (which subsequently 'use's three or four other modules) with 'use
|| strict'
|| > __ and the '-w' switch on. It's running as a CGI executing with Perl
|| 5.00502
|| > __ on an Apache server on an HPUX 10.20 machine (a Merlin, I believe).
|| >
|| >
|| > Those are the "details"? A pretty vague description? 4 lines of text,
|| > describing 5 lines of code? How about being a bit more detailed, and
|| > at least displaying the second and fourth line of code?
||
||
|| The actual code where the problem happens covers about 4000 lines...I'm
|| assuming not everyone wants to read through this. The 'details' section was
|| really intended to let you folks know in what environment my code is
|| running.
Then why are you saying "The script is a five-line driver script"?
5 or 4000, that's quite difference. Besides, even it it's 4000 lines in
total, you should be able to isolate the part that gives problems. You
could than post the isolated part. Otherwise, we just have to say
"The error is in line 17"
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
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 5209
**************************************