[11454] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5054 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 4 15:07:17 1999

Date: Thu, 4 Mar 99 12:00:24 -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           Thu, 4 Mar 1999     Volume: 8 Number: 5054

Today's topics:
    Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Pos (Ilya Zakharevich)
    Re: -- # -*-Perl-*- in perl script (Steve Linberg)
        Beginning Perl Programmer <mfenning@voicenet.com>
    Re: Beginning Perl Programmer (Steve Linberg)
    Re: Beginning Perl Programmer (Larry Rosler)
        Case of the missing cc and re <m-fuerst@cecer.army.mil>
    Re: Case of the missing cc and re <jeromeo@atrieva.com>
    Re: Case of the missing cc and re <jglascoe@giss.nasa.gov>
    Re: Help needed on pattern matching in reverse (Steven Alexander)
        Help with Perl CGI script type conversion (Bill Morland)
    Re: Help with Perl CGI script type conversion <jglascoe@giss.nasa.gov>
        HELP with type conversion in Perl (Bill Morland)
    Re: HELP with type conversion in Perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: HELP with type conversion in Perl (Steve Linberg)
        Help: How to pass thru apostrophe <denix@cfer.com>
    Re: Help: How to pass thru apostrophe (Steve Linberg)
        How to steal the output from a program <audic@newton.cnrs-mrs.fr>
    Re: How to steal the output from a program <tbriles@austin.ibm.com>
    Re: Howto open COM1: in dos Perl (Aart Koelewijn)
    Re: Issuing CTL-ALT-DEL from PERL (Larry Rosler)
    Re: Issuing CTL-ALT-DEL from PERL (Larry Rosler)
    Re: Load an Array from a file. <jglascoe@giss.nasa.gov>
        MS Excel to HTML converter? <gary.kakazu@tdstelecom.com>
        newbie:looking for a sorting script <onyx@szm.de>
    Re: nmake, adding modules in Win 98 <cj@interlog.com>
        Passing quoted args in backquotes <jalil@corp.home.net>
    Re: Pentium III Chips Released with IDs - Intel won't b (Thane Hubbell)
        Perl - deleting files that are 2 days old (KLMN2)
    Re: Perl - deleting files that are 2 days old (Steve Linberg)
    Re: Perl - deleting files that are 2 days old <jglascoe@giss.nasa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 4 Mar 1999 18:55:57 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
Message-Id: <7bmkvt$r04$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Philip Newton 
<Philip.Newton@datenrevision.de>],
who wrote in article <36DE749C.66F74C6A@datenrevision.de>:
> > Why "her"?
> 
> Because "Abigail" is, to my knowledge, only a female given name. I
> assumed it is Abigail's own given name

Why?  ;-) 

Since the "standard" way of addressing yourself is not used, why do
you suppose that other "standard" assumption apply?  Obviously,
"Abigail" is used as a call name.  It might coincide with the given
name, it might not.

Ilya


------------------------------

Date: Thu, 04 Mar 1999 13:02:21 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: -- # -*-Perl-*- in perl script
Message-Id: <linberg-0403991302210001@ltl1.literacy.upenn.edu>

In article <36DE14E2.76155B2E@erols.com>, "Matthew O. Persico"
<mpersico@erols.com> wrote:

> Russ Allbery wrote:
> > If you're using a recent version of emacs, you don't need it at all.
> > #!/usr/local/bin/perl will be sufficient for emacs to figure out that it's
> > a Perl script.
> > 
> 
> And, if you are running multiple versions of Perl (for testing or
> adventure) and you swap the versions in and out of your path, this
> shebang will work no matter where ON YOUR PATH perl is located:

Very cool!  I thought it was doing it based on the filename extension, but
this is a nice addition.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: Thu, 4 Mar 1999 13:02:41 -0500
From: "Matt Fenning" <mfenning@voicenet.com>
Subject: Beginning Perl Programmer
Message-Id: <QWzD2.612$an6.2194@news2.voicenet.com>

Can i install and develop in Perl on Windows 95,98 or WinNT?
If so where can I get the source code?




------------------------------

Date: Thu, 04 Mar 1999 14:11:51 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Beginning Perl Programmer
Message-Id: <linberg-0403991411510001@ltl1.literacy.upenn.edu>

In article <QWzD2.612$an6.2194@news2.voicenet.com>, "Matt Fenning"
<mfenning@voicenet.com> wrote:

> Can i install and develop in Perl on Windows 95,98 or WinNT?

Yes.

> If so where can I get the source code?

You can get Perl for Win32 at www.activestate.com, among other places.  I
don't know if the source code for Perl-Win32 is what you want, but I'm not
sure that's available.  The source for Perl itself is available from
www.perl.com.  You don't need the source for Perl to write in Perl.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: Thu, 4 Mar 1999 11:39:48 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Beginning Perl Programmer
Message-Id: <MPG.114881613438ebc49896dc@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <QWzD2.612$an6.2194@news2.voicenet.com> on Thu, 4 Mar 1999 
13:02:41 -0500, Matt Fenning <mfenning@voicenet.com> says...
> Can i install and develop in Perl on Windows 95,98 or WinNT?
> If so where can I get the source code?

Wouldn't it be most unlikely that you couldn't use Perl on >90% of the 
world's computers?

Get thee to

<URL:http://www.activestate.com/>

look for ActivePerl, and have fun.  You won't get the source code 
(unless you insist, I guess).  You will get easy-to-install binaries and 
documentation, and excellent support.

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 04 Mar 1999 12:34:51 -0600
From: Michael Fuerst <m-fuerst@cecer.army.mil>
Subject: Case of the missing cc and re
Message-Id: <36DED24A.E632C15F@cecer.army.mil>

*******Question 1
Can someone show me (a new PERL convert)
one or more PERL statements which
can  take a string of comma separated words, with intervening
spaces, tabs and new lines,  and put them
into an array?

My attempt below doesn't quite work--and would
like to know where I went wrong.
I obviously am overlooking one or two important principles.
Thanks for any insights you can give me.

# A word must start with a letter or _ and may be surrrounded by
optional white space
$word = '\s*[a-zA-Z_]\w*\s*';
# A word list can be a comma separated list of words or just a word.
# The ?:'s are intended to group w/o filling the array
$wordlist =  "(?:(?:(?:($word),)+($word))|($word))";
# The following puts a zero length string in each of
#   $oo[0] and  $oo[1], and aa into $oo[2]
# I had hoped just to see aa in $oo[0]
@oo  =   'aa' =~ m"$wordlist"smg;
print @oo[0] . " " . length(@oo[0]) . "\n";
print @oo[1] . " " . length(@oo[1]) . "\n";
print @oo[2] . " " . length(@oo[2]) . "\n";
# The following puts aa and bb string in each of
#   $pp[0] and  $pp[1] (as I expected) ,
#   and a zero length string into $pp[2] (I expected
#   pp to have only 2 elements!!)
@pp  =   'aa, bb' =~ m"$wordlist"smg;
print @pp[0] . " " . length(@pp[0]) . "\n";
print @pp[1] . " " . length(@pp[1]) . "\n";
print @pp[2] . " " . length(@pp[2]) . "\n";
# The following puts bb into $qq[0],
#   a space and cc into $qq[1] (both as expected
#   and a zero length string into $qq[2]
# (I expected aa, bb and space cc to be in the the 3 elements of qq
@qq  =   'aa,bb, cc' =~ m"$wordlist"smg;
print @qq[0] . " " . length(@qq[0]) . "\n";
print @qq[1] . " " . length(@qq[1]) . "\n";
print @qq[2] . " " . length(@qq[2]) . "\n";




*** Question 2
I installed ActiveState Perl on my NY pc,
and, following the advice in the documentation,
put   use re 'debug' ;    as the 1st line of a script.
PERL laments that it can't find re.
Did I do something wrong in the installation?

If not, where can I get re?



Thanks

--
(If this message was posted to a newsgroup,
please reply to both me and the newsgroup.)

Michael Fuerst

Work: Construction Engineering Research Lab
      Box 9005
      Champaign  IL  62826        217-373-7273

Home: 802 N Broadway
      Urbana IL 61801       217-239-5844




------------------------------

Date: Thu, 04 Mar 1999 10:59:56 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Michael Fuerst <m-fuerst@cecer.army.mil>
Subject: Re: Case of the missing cc and re
Message-Id: <36DED82C.EADFB402@atrieva.com>

Michael Fuerst wrote:
> 
> *******Question 1
> Can someone show me (a new PERL convert)
> one or more PERL statements which
> can  take a string of comma separated words, with intervening
> spaces, tabs and new lines,  and put them
> into an array?
> 
> My attempt below doesn't quite work--and would
> like to know where I went wrong.

my($string) = 'Foo, Bar is whereI wanna be, doh! my dear';
my(@array) = split(/,/,$string);

For all the exciting detail on split(), and other perl functions to
manipulate scalar data, read the perlfunc documentation that came with
your perl distribution.  You might also want to read the perl regular
expression document, perlre, as split takes a regex,  not a string as an
argument.

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: Thu, 04 Mar 1999 14:00:54 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Michael Fuerst <m-fuerst@cecer.army.mil>
Subject: Re: Case of the missing cc and re
Message-Id: <36DED866.10AB4532@giss.nasa.gov>

[Cc of post sent to cited author via email]

Michael Fuerst wrote:
> 
> *******Question 1
> Can someone show me (a new PERL convert)
> one or more PERL statements which
> can  take a string of comma separated words, with intervening
> spaces, tabs and new lines,  and put them
> into an array?

I'm not sure I understand your meaning.
This code simply splits the string at every
comma:

my @list = split /,/, $string;

	Jay Glascoe
--
	"The early bird gets the worm, but
	 the second mouse gets the cheese."


------------------------------

Date: 4 Mar 1999 10:22:40 -0800
From: stevena@user2.teleport.com (Steven Alexander)
Subject: Re: Help needed on pattern matching in reverse
Message-Id: <7bmj1g$k4$1@user2.teleport.com>

As Larry said, if the search pattern is a plain string,
rindex() IOWTDI.

If not, however, the earlier suggestion of printing the *last*
member of the array of forward m// matches can be a mistake:

#!/usr/local/bin/perl -lw
use strict;

my $search = 'ofoo';
my $string = 'skadooFoofoo';

my @a      = ($string =~ /$search/gi);
print $a[-1];

for ($search, $string) { $_ = scalar reverse $_; }

@a         = ($string =~ /$search/gi);
print scalar reverse $a[-1];
__END__
oFoo
ofoo

-- 
Steven Alexander
stevena@teleport.com
perl -le 'print map{chr($_?64+((0<=>$_)+(-1+$_**2)**2)%17:())}-2..2;'


------------------------------

Date: Thu, 04 Mar 1999 18:33:02 GMT
From: billm@concentric.net (Bill Morland)
Subject: Help with Perl CGI script type conversion
Message-Id: <bwAD2.5847$SI4.1195643@hme2.newscontent-01.sprint.ca>

If you look at the following chunk of code:

print header;
print start_html('A Simple Example'),
    h1('A Simple Example'),
    start_form,
    "CD Code     ",testfield('cdcode'),
    p,
    "Artist Code ",textfield('artistcode'),
    p,
    "Song Code   ",textfield('songcode'),
    p,
    submit,
    end_form,
    hr;

When run as a CGI script, this creates a simple HTML form.

My problem is I want to use the"post"ed variables as integers, not character 
strings.

How can I get the form to retrun integer values? or how can I convert a text 
string to an integer in Perl?

Thanks,

Bill M.


------------------------------

Date: Thu, 04 Mar 1999 14:27:39 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Bill Morland <billm@concentric.net>
Subject: Re: Help with Perl CGI script type conversion
Message-Id: <36DEDEAB.B972DDE1@giss.nasa.gov>

[posted and mailed]

Bill Morland wrote:
> 
<snip>
> My problem is I want to use the"post"ed variables as integers, not character
> strings.
> 
> How can I get the form to retrun integer values? or how can I convert a text
> string to an integer in Perl?

Perl silently converts strings to (and fro) numbers on demand.
For example:

print "7" * 5 x 2;

here, perl converts "7", the string, to a number.  perl then
multiplies 7 and 5, obtaining 35.  This result is then converted
to a string, "35".  perl concatenates said string with itself,
and prints the result.

--  
"Narf!"
  --Pinky


------------------------------

Date: Thu, 04 Mar 1999 18:45:27 GMT
From: billm@concentric.net (Bill Morland)
Subject: HELP with type conversion in Perl
Message-Id: <PHAD2.5863$SI4.1195643@hme2.newscontent-01.sprint.ca>

If you look at the following chunk of code:

print header;
print start_html('A Simple Example'),
    h1('A Simple Example'),
    start_form,
    "CD Code     ",testfield('cdcode'),
    p,
    "Artist Code ",textfield('artistcode'),
    p,
    "Song Code   ",textfield('songcode'),
    p,
    submit,
    end_form,
    hr;

When run as a CGI script, this creates a simple HTML form.

My problem is I want to use the"post"ed variables as integers, not character 
strings.

How can I get the form to retrun integer values? or how can I convert a text 
string to an integer in Perl?

Thanks,

Bill M.


------------------------------

Date: 04 Mar 1999 20:07:58 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: HELP with type conversion in Perl
Message-Id: <83iuch13ap.fsf@vcpc.univie.ac.at>

Re: HELP with type conversion in Perl, Bill
<billm@concentric.net> said:

Bill> If you look at the following chunk of code:
Bill> print header; print start_html('A Simple
Bill> Example'), h1('A Simple Example'), start_form,
Bill> "CD Code ",testfield('cdcode'), p, "Artist
Bill> Code ",textfield('artistcode'), p, "Song Code
Bill> ",textfield('songcode'), p, submit, end_form,
Bill> hr;

 ... print end_html;

Bill> How can I get the form to retrun integer

A FORM doesn't *return* anything, it's just a blob
of HTML.

Bill> values? or how can I convert a text string to
Bill> an integer in Perl?

You don't!  Perl is clever.  It does it for you.

E.g.

$n = "100";
$m = $n + 1;
print "$m\n";

(is this in the FAQ somewhere?  I couldn't see it
addressed explicitly in perlfaq4)

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


------------------------------

Date: Thu, 04 Mar 1999 14:10:11 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: HELP with type conversion in Perl
Message-Id: <linberg-0403991410120001@ltl1.literacy.upenn.edu>

In article <PHAD2.5863$SI4.1195643@hme2.newscontent-01.sprint.ca>,
billm@concentric.net (Bill Morland) wrote:

> How can I get the form to retrun integer values? or how can I convert a text 
> string to an integer in Perl?

This question suggests that you really need to read up on the very basics
of Perl.  Scalars are scalars in Perl, and they behave the way they're
treated.  If you want your scalar to behave like an integer, do some math
with it.  No conversion is necessary.

my $scalar_value = "1234";
print qq(Scalar value is "$scalar_value"\n);
print "A string manuplation: " . reverse ($scalar_value) . "\n";
print "A numeric manipulation: " . ($scalar_value + 1) . "\n";
__END__

Scalar value is "1234"
A string manuplation: 4321
A numeric manipulation: 1235

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: Thu, 04 Mar 1999 12:07:43 +0000
From: Dean Enix <denix@cfer.com>
Subject: Help: How to pass thru apostrophe
Message-Id: <36DE778F.491BE38@cfer.com>

The following perl statement works okay

    `/usr/bin/cut -d'|' -f1,3- $results \> filtered.out`;

 but when I try to change the delimiter to ' (apostrophe) it doesn't get
passed thru... 

What are the rules here?

Any suggestions on a solution?

Thx in advance


------------------------------

Date: Thu, 04 Mar 1999 14:14:16 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Help: How to pass thru apostrophe
Message-Id: <linberg-0403991414160001@ltl1.literacy.upenn.edu>

In article <36DE778F.491BE38@cfer.com>, Dean Enix <denix@cfer.com> wrote:

> The following perl statement works okay
> 
>     `/usr/bin/cut -d'|' -f1,3- $results \> filtered.out`;
> 
>  but when I try to change the delimiter to ' (apostrophe) it doesn't get
> passed thru... 
> 
> What are the rules here?

The rules are that the backtick (`) operator is used to pass strings to
the shell and capture any output.

> Any suggestions on a solution?

What's the problem?

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: 04 Mar 1999 20:01:07 +0100
From: Stephane Audic <audic@newton.cnrs-mrs.fr>
Subject: How to steal the output from a program
Message-Id: <4xu2w1m64s.fsf@newton.cnrs-mrs.fr>


Hi, 

I am trying to write a script in perl which gets some important info
from an external program. However, this external program does not
cooperate and refuses me its output. Does anyone know of a workaround?

This is a program that work:

#!/usr/bin/perl
$cooperative_program = "ls" ; 
$res = `$cooperative_program` ; 
# And now $res contains the output of my cooperative program

This is a program that does not work:

#!/usr/bin/perl
$non_cooperative_program = "my_silly_program" ; 
$res = `$non_cooperative_program` ; 
# And now $res contains nothing 

In both cases, running the program directly from the shell give me 
the right answer on standart output. I would greatly appreciate a hint. 

Many thanks by advance.

-- 
Stephane Audic,    audic@igs.cnrs-mrs.fr
Information Genetique et Structurale
31 ch. Joseph Aiguier
13402 MARSEILLE Cedex 20 


------------------------------

Date: Thu, 04 Mar 1999 13:49:57 -0600
From: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: How to steal the output from a program
Message-Id: <36DEE3E5.C6B091F3@austin.ibm.com>

Stephane Audic wrote:

> #!/usr/bin/perl

Use the -w flag.  It would probably tell you what's wrong.

> $non_cooperative_program = "my_silly_program" ;
> $res = `$non_cooperative_program` ;
> # And now $res contains nothing

Check the PATH variable, and the permissions.  my_silly_program is
probably not in your PATH.

- Tom



------------------------------

Date: 4 Mar 1999 09:21:08 GMT
From: aart@mtack.xs4all.nl (Aart Koelewijn)
Subject: Re: Howto open COM1: in dos Perl
Message-Id: <7blja4$c6m$1@mtack.xs4all.nl>

Hi Bill:

Thanks for the reaction, after posing the question I got simular
information from someone else.

In article <19990303173558.27405.00002943@ng126.aol.com>,
	bbirthisel@aol.com (Bbirthisel) writes:
> Hi Aart:
> 
> I hate to be the bearer of bad news, but with the hardware and OS
> constraints you have outlined, Perl is not the best choice for your task.
> My choice would be to install a minimum linux distribution and give
> the users a restricted shell (or a least a "short" $PATH) plus some
> scripts to handle the tasks they need in a low-training setting.

Just to see how this works, I think I will make one user, name is the
name of the program, no password, no shell, will directly start the
program which will handle everything. Logfiles from the program will
either be written to a DOS floppy, or to the DOS partition. When the
program stops, the user is logged-out. I think this should work.

> The alternative would be another language. There are a few simple
> template serial programs for the DJGPP C compiler. Even QBASIC
> has limited capabilities to handle serial ports - one at a time, slow,
> nothing else going on - but might be enough for what you propose.

I have very little programming experience, and know almost nothing about
DOS. As the program is needed yesterday (as always ;-)) learning to work
with another programming language and OS is no option.

> I think you have taken the wrong approach to this problem.

I think it was the only way I am able (within a reasonable amount of
time) to make this work at all. And as a matter of fact, that it is
possible to do something with a few lines of Linux Perl code, that is
very difficult to achieve in DOS, is something I like a lot ;-). Anyway,
I am the only one on the job who had the idea that it would be possible
to reverse-engeneer an existing DOS program and add some highly needed
functionality to it (did the reverse-engenering by making the DOS
program run in dosemu with debugging on for the serial port).

Aart

-- 
Aart Koelewijn                |  Linux 2.0.36
E-mail: aart@mtack.xs4all.nl  |  my newsserver kills all
http://www.xs4all.nl/~mtack/  |  Content-Type: multipart/* messages


------------------------------

Date: Thu, 4 Mar 1999 10:31:59 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Issuing CTL-ALT-DEL from PERL
Message-Id: <MPG.114871757adb96a89896d6@nntp.hpl.hp.com>

In article <7bks6e$b7a$1@nnrp1.dejanews.com> on Thu, 04 Mar 1999 
02:46:41 GMT, l_burchard@my-dejanews.com <l_burchard@my-dejanews.com> 
says...
>   Does anyone know how to issue a CTL-ALT-DEL from a PERL script from an NT
> workstation (assuming you are an administrator) to another NT workstation in
> order to lock it?  Or if there is another way to lock a workstation remotely,
> that would be fine too.  We are having difficulty figuring out how to issue 3
> characters (CTL-ALT-DEL) simultaneously.

It is not three characters, it is one character (just as CTL-anything is 
one character).  But I cannot figure out what character it is, because I 
cannot get CTL-ALT-anything through the I/O system to a Perl program.  
CTL-ALT-DEL is trapped immediately by the operating system, and CTL-DEL-
anything seems not to deliver any character, even to sysread() with 
binmode set.

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 4 Mar 1999 11:34:27 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Issuing CTL-ALT-DEL from PERL
Message-Id: <MPG.11488022847ceb7a9896db@nntp.hpl.hp.com>

In article <7bks6e$b7a$1@nnrp1.dejanews.com> on Thu, 04 Mar 1999 
02:46:41 GMT, l_burchard@my-dejanews.com <l_burchard@my-dejanews.com> 
says...
>   Does anyone know how to issue a CTL-ALT-DEL from a PERL script from an NT
> workstation (assuming you are an administrator) to another NT workstation in
> order to lock it?  Or if there is another way to lock a workstation remotely,
> that would be fine too.  We are having difficulty figuring out how to issue 3
> characters (CTL-ALT-DEL) simultaneously.

It is not three characters, it is one character (just as CTL-anything is 
one character).  But I cannot figure out what character it is, because I 
cannot get CTL-ALT-anything through the I/O system to a Perl program.  
CTL-ALT-DEL is trapped immediately by the operating system, and CTL-ALT-
anything seems not to deliver any character, even to sysread() with 
binmode set.

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 04 Mar 1999 13:32:50 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: "Robert B. Ganz" <rganz@rushu.rush.edu>
Subject: Re: Load an Array from a file.
Message-Id: <36DED1D2.6E373395@giss.nasa.gov>

[courtesy copy of post sent to cited author, Bob, via email]

"Robert B. Ganz" wrote:
> 
> Hi,
> 
> I was wonder if Perl is capable of loading an array from a file?
> I can't seem to find sample code in either the Lama or the Camel books.
> 
> I want to do something like this.

<snip>

@lines = <FH>;	# a list of lines

chomp(@lines = <FH>);	# a list of "chomped" lines

push @words, split while (<FH>);  # a list of all "words" in the file

push @words, [split] while (<FH>);  # a list of lists of words

> Any help would be great!
> 
> Tx,
> Bob

I think you want the first or second example.

	Jay Glascoe
--  
"Just say 'Narf'."
  --Pinky


------------------------------

Date: Thu, 04 Mar 1999 11:57:27 -0600
From: Gary Kakazu <gary.kakazu@tdstelecom.com>
Subject: MS Excel to HTML converter?
Message-Id: <36DEC986.F1578F4F@tdstelecom.com>

I'd like to automate the process of taking Microsoft Excel files and
displaying them on the web. Are there any perl modules that will take an
Excel file (.xls format) and convert it to an HTML table?

Thanks,
Gary
gary.kakazu@tdstelecom.com



------------------------------

Date: Thu, 04 Mar 1999 18:27:44 +0100
From: SZM-studios <onyx@szm.de>
Subject: newbie:looking for a sorting script
Message-Id: <36DEC290.A74D3C44@szm.de>

sorry if i'm wrong here, pleeze forgive me...

i am looking for a script that reads the content of the CWD , sth like
this:

obelix&falbala.scene1.126.pic
obelix&falbala.scene1.127.pic
obelix&falbala.scene1.128.pic
obelix&falbala.scene1.129.pic
 ...

and writes out sth like

obelix&falbala.scene1.[126-234].pic

 .

I thought perl is suitable for this task, but i'm totally new to perl.
anyone got an idea for me??

my email is: gonzhauser@yahoo.de

and thanx lot...




------------------------------

Date: Thu, 4 Mar 1999 13:03:11 -0500
From: "Christopher R. Jones" <cj@interlog.com>
Subject: Re: nmake, adding modules in Win 98
Message-Id: <7bmhu5$6bd$1@news.interlog.com>

Nname works fine as long and you don't need to compile any c modules that
were not explicitly written with VC++ in mind.  I am trying to get the
Postgresql Perl module to install in NT and VC++ gives all kinds of errors
where gnu compilers don't.






------------------------------

Date: Thu, 04 Mar 1999 18:15:58 GMT
From: "Jalil Feghhi" <jalil@corp.home.net>
Subject: Passing quoted args in backquotes
Message-Id: <920571358.719890@zeppelin.svr.home.net>

I need to run a command that should take a quoted arg. Something like:

`cmd "-v $arg"`

I have tried the above, escaping the quotes, and also defining a var like
($a = "-v $arg") and then use it inside the backquote as in `cmd $a`. None
worked!

Any way to do this?


Thanks,

-Jalil





------------------------------

Date: 4 Mar 99 20:41:30 GMT
From: redsky@ibm.net (Thane Hubbell)
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <Jl0PnHJ5PvPd-pn2-8xbS2Qqz9ZRc@Dwight_Miller.iix.com>

On Thu, 4 Mar 1999 08:19:24, "Caisson" <caisson@telebyte.nl> wrote:

> paul milligan <pjm@see_my_sig_for_address.com> schreef in artikel
> <36e08964.75304572@news.concentric.net>...
> 
> Hello Paul,
> 
> > redsky@ibm.net (Thane Hubbell) pondered briefly, and wrote:
> > 
> > 	{ post list allowed, because this aspect does relate across
> > platforms / groups, IMO }
> > 
> > >I mentioned in a earlier message that I wrote a copy protection scheme
> > >for my software based on BIOS data and machine type.  This was a 
> > >FIASCO from day one, as users would change machines, upgrade machines 
> > >etc.  Trying to ID a PERSON from a CPU ID is nuts.  The best you can 
> > >do is ID the CPU.  This will be a good thing for software licenses - 
> > >to an individual CPU.  I see this coming, actually, from MicroSoft.  
> > >Buy Windows 98/2000 and install it on "THIS" CPU - but no other.  
> > 
> > 	Certainly do-able, and likely to happen ( not just Windows,
> > but all platforms / languages ).
> > 
> > >Great for software sales.  But as a method to ID a particular 
> > >consumer?   Not a chance.
> > 
> > 	Do you license a person or a copy ( therefore one machine ) ?
> > Personally, I license per copy, not per person.  You want to run it on
> > another machine, you buy another ( discounted ) license.
> 
> So, You are telling me that if I buy some software, use it on some machine,
> upgrade (downgrade ?) to some other machine I have to pay again ?  Nice
> move !  No wonder Unix is winning terrain ...
>

This license scheme has been used for decades on Mainframe hardware.  
If you change machines, you negotiate a new license - most times free 
- sometimes (as in IBM's pricing based on performance method) at a 
higher or lower fee.

I personally do not USE this method any longer.  The ill will of the 
individual user did not make up for the thieves stealing the software.
 In the end the legit users pay higher prices because of the thieves. 




------------------------------

Date: 4 Mar 1999 19:07:33 GMT
From: klmn2@aol.com (KLMN2)
Subject: Perl - deleting files that are 2 days old
Message-Id: <19990304140733.12880.00003030@ng-fi1.aol.com>

Hi -
    I am trying to write code for a Perl script which would delete all files in
a certain directory which are over 2 days old. If anyone can help me, I would
greatly appreciate it. (This is on a UNIX machine).

Thanks,
Kalman Kaminer


------------------------------

Date: Thu, 04 Mar 1999 14:17:59 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl - deleting files that are 2 days old
Message-Id: <linberg-0403991417590001@ltl1.literacy.upenn.edu>

In article <19990304140733.12880.00003030@ng-fi1.aol.com>, klmn2@aol.com
(KLMN2) wrote:

> Hi -
>     I am trying to write code for a Perl script which would delete all
files in
> a certain directory which are over 2 days old. If anyone can help me, I would
> greatly appreciate it. (This is on a UNIX machine).

You can start with:

perldoc -f stat
perldoc -f unlink

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


------------------------------

Date: Thu, 04 Mar 1999 14:44:20 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: KLMN2 <klmn2@aol.com>
Subject: Re: Perl - deleting files that are 2 days old
Message-Id: <36DEE294.326BF463@giss.nasa.gov>

[courtesy copy of post sent to cited author, Kalman, via email]

KLMN2 wrote:
> 
> Hi -
>     I am trying to write code for a Perl script which would delete all files in
> a certain directory which are over 2 days old. If anyone can help me, I would
> greatly appreciate it. (This is on a UNIX machine).
> 
> Thanks,
> Kalman Kaminer

my @file_list = grep { -f and -M > 2 } <./*>;
unlink foreach @file_list;

See also: perfaq5 "How do I get a file's timestamp in perl?"

	Jay Glascoe
--  
"Narf!"
  --Pinky


------------------------------

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 5054
**************************************

home help back first fref pref prev next nref lref last post