[11948] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5548 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 3 09:07:19 1999

Date: Mon, 3 May 99 06:00:21 -0700
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, 3 May 1999     Volume: 8 Number: 5548

Today's topics:
        .htpasswd <s.filipowicz@orades.nl>
    Re: .htpasswd (Bart Lateur)
        A Question About Visual Perl <ian.taite@nospam.zen.co.uk>
    Re: A Question About Visual Perl (Bart Lateur)
    Re: A Question About Visual Perl <tchrist@mox.perl.com>
    Re: calling with strings (Alastair)
    Re: Can I output contents of multiple subdirectories? (Christoph Schmitz)
    Re: Concatenating files with PERL <tim@timbury.com>
        dbm-Database from Unix to Windows <poehnlsn@iis.fhg.de>
    Re: embed cgi in HTML <occitan@esperanto.org>
    Re: Exit code question.. <nospam.newton@gmx.net>
        GETting a Web-Site with IO::Socket::INET <keitgen@keitgen.de>
    Re: GETting a Web-Site with IO::Socket::INET (I R A Aggie)
    Re: GETting a Web-Site with IO::Socket::INET <keitgen@keitgen.de>
    Re: HELP: opening files in perl and streaming them to w (Larry Rosler)
    Re: How do i print something using perl? <nospam.newton@gmx.net>
        inserting "|" and " ' " to Access???? jckchan@hotmail.com
    Re: inserting "|" and " ' " to Access???? (Scott McMahan)
        Is this a bug? <silver@silverchat.com>
        Need help in PERL... <vnataraj@ae0181.pd8.ford.com>
    Re: newbie in need... <nospam.newton@gmx.net>
    Re: Newsfeed and Local Weather <rra@stanford.edu>
        Perl in the workplace sstarre@my-dejanews.com
    Re: Perl on a 386 with 2 MB RAM??? <nospam.newton@gmx.net>
        remove all chars of a type except first and last. <vicuna@my-dejanews.com>
        Runninf external programs from Perl on NT adrianobarenco454@my-dejanews.com
        Running an external program from Perl on NT barenco@yahoo.com
    Re: sorting data in perl (Bob Trieger)
    Re: why doesn't redeclaring $i give warning/errors? sstarre@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 03 May 1999 11:31:35 +0200
From: Steven Filipowicz <s.filipowicz@orades.nl>
Subject: .htpasswd
Message-Id: <372D6CF7.A5D100BA@orades.nl>

Hi All,

I'm looking for a script that can/will convert a string to an encrypted
password that can be used in the .htpasswd file.
Is this possible?

Thanks for any help!


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

Date: Mon, 03 May 1999 12:18:48 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: .htpasswd
Message-Id: <373492ed.14045036@news.skynet.be>

Steven Filipowicz wrote:

>I'm looking for a script that can/will convert a string to an encrypted
>password that can be used in the .htpasswd file.
>Is this possible?

Yes. Easily.

	$salt = "xy";  #you need two letters, digits, or something
	$encrypted = crypt($pwd,$salt);
	open(PWD,">>.htpasswd") or die "Can't open password file;
	print PWD "$user:$encrypted\n";

To be on the safe side, you should do file locking on the password file.

Also do a DejaNews search in this newsgroup (www.dejanews.com) for more
elaborate examples.

	Bart.


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

Date: Mon, 3 May 1999 09:24:21 +0100
From: "Ian Taite" <ian.taite@nospam.zen.co.uk>
Subject: A Question About Visual Perl
Message-Id: <84dX2.25$B%1.17@news-reader.bt.net>

Yet another question about the mythical Visual Perl.
Does such a beast exist yet?
The only products I've come across so far which go someway towards this goal
are:
1. PerlBuilder - simple, easy to use, but debugger sometimes causes eratic
program flow,
2. ActiveState's Perl Development Kit (PDK), containing GUI debugger - nice
debugger but uses NOTEPAD for editor,
3. Some tweeks to Visual Studio, but who wants to use M$'s mammoth and
confusing IDE?

Do you know of any others? Have you used any others?




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

Date: Mon, 03 May 1999 12:23:33 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: A Question About Visual Perl
Message-Id: <373594bb.14507340@news.skynet.be>

Ian Taite wrote:

>Yet another question about the mythical Visual Perl.
>Does such a beast exist yet?

Not an answer, but a counter-question.

What do people (like you) expect of a "Visual Perl"? Since Perl cannot
be used for development of GUI stuff, apart from Tk and Macintosh
oriented stuff, I simply cannot imagine what it could be good for. Perl
is a "text only" oriented language to me.

	Bart.


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

Date: 3 May 1999 06:38:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A Question About Visual Perl
Message-Id: <372d98b9@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, bart.lateur@skynet.be (Bart Lateur) writes:
:Perl is a "text only" oriented language to me.

Please don't tell the authors and users of Gtk.pm module about that.

--tom
-- 
 He who hasn't hacked assembly language as a youth has no
 heart. He who does so as an adult has no brain.


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

Date: Mon, 03 May 1999 12:55:17 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: calling with strings
Message-Id: <slrn7iranq.5j.alastair@calliope.demon.co.uk>

joeyandsherry@mindspring.com <joeyandsherry@mindspring.com> wrote:
>Thanks for your assistance:
>
>I wish to write a script that I can link to with somewhat this format:
>
>http://mydomain.com/cgi-bin/thescript.pl
>
>But, I'd also like to include a string value with the link
>some what like this:
>
>http://mydomain.com/cgi-bin/thescript.pluserid=1234
>
>and have the ability to recognize the strings value.

That's really a CGI question and you'd be best asking in a CGI group. You might
want to check out the CGI.pm perl module however. See the CGI.pm docs ;

http://stein.cshl.org/~lstein/

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 3 May 1999 11:24:48 GMT
From: schm4704@pcpb08.uni-trier.de (Christoph Schmitz)
Subject: Re: Can I output contents of multiple subdirectories?
Message-Id: <7gk120$90t$1@fu-berlin.de>

Mitch (portboy@home.com) wrote:
: Let me lay the groun work for my question first:

: Currently my script is using a "base" directory say /foo/bar.  In that
: directory are stored sub directories and files, e.g.
: /foo/bar/1234/foo.pem and bar.pem, or /foo/bar/5678/foo.pem and
: bar.pem.  These files are strictly ascii text.  Now, my question is -
: How can I output the contents of all directories under /foo/bar?  At the

Honestly, I don't really understand the question, but here's my 2 cents
anyway.

You can use the File::Find module for subdirectory traversal; use
perldoc File::Find for details.

Let's assume you want to output all regular files under /foo/bar. Here
we go:

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

#!/usr/bin/perl

use File::Find;

sub wanted {
  return unless -f; # make sure this is a regular file

  print "File: $_\n";
  open FH, "< $_" or die "$0: $!";
  undef $/; # undef INPUT_RECORD_SEPARATOR to make the following line
            # swallow the entire file at once
  $input = <FH>;
  print $input;
  close FH;
}

finddepth ( \&wanted, '/home/cschmitz/test' );

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

Hope this helps,

Christoph

--
**** Christoph Schmitz  <cschmitz@stud.informatik.uni-trier.de> ****
The next time you look in the mirror, ask yourself how you'd feel if 
you were a cat, and Earth was visited by something looking like you.
                                                       (Roger Ebert)


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

Date: Mon, 3 May 1999 03:49:11 -0400
From: "Tim" <tim@timbury.com>
Subject: Re: Concatenating files with PERL
Message-Id: <925717752.684.17@news.remarQ.com>

-------------------------------
COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination
  [/A | /B]] [/V] [/N]

  source       Specifies the file or files to be copied.
  /A           Indicates an ASCII text file.
  /B           Indicates a binary file.
  destination  Specifies the directory and/or filename for the new file(s).
  /V           Verifies that new files are written correctly.
  /N           Uses short filename, if available, when copying a file with a
               non-8dot3 name.
  /Z           Copies networked files in restartable mode.

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).

C:\>copy test1.txt+test2.txt+test3.txt catty.txt
test1.txt
test2.txt
test3.txt
        1 file(s) copied.

C:\>type catty.txt
testfile 1
testfile 2
testfile 3
----------------------------------------------

Hope this helps,
Tim K.

C:\>
psychout wrote in message <01be9336$7635b1a0$0201010a@psychout>...
>I'm new to PERL and trying to figure out how to use PERL to concatenate 3
>files together into one file on an NT system. Can anyone help me?
>Thanks.




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

Date: Mon, 3 May 1999 11:34:33 +0200
From: "Stefan Pvhnlein" <poehnlsn@iis.fhg.de>
Subject: dbm-Database from Unix to Windows
Message-Id: <925725039.769248@news.fhg.de>

Hi there everyone,

I have a problem concerning the change of my os.
I want to use now a perl script, originally used under Linux, under the
Personal Web Server of Windows 98.

The script works now.

The only problem left are the dbm-databases.
It seems that the databases made in Linux could not be used with Windows 98.

If the db-directory is empty there are no problems with perl.
It creates the necessary databases (pag,.. files ) itself.

But when I copy the existing databases into the directory, perl can't use
them.

Does anybody know, how I can use the existing databases without hacking in
all the data again ?

Has anybody experience with portating perl from a Unix-System to a
Microsoft-Windows System ?

Please write to Stefan Poehnlein:
poehnlsn@iis.fhg.de

Many thanks in advance, Stefan




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

Date: Mon, 03 May 1999 08:45:41 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: Re: embed cgi in HTML
Message-Id: <7gjnnl$g4t$1@nnrp1.dejanews.com>

In article <7giu7n$did@dfw-ixnews12.ix.netcom.com>,
  "Jane H." <memberjh@yahoo.com> wrote:

> Scruffles wrote in message <372cf2cb.515071193@news.inlink.com>...
> >I want to inclued a CGI generated peice of HTML into a web page.  I
> >would like to be able to load the web page into an HTML editor when
> >needed, so making the hole thing a Here document is out of the
> >question (unless I am missing something).

> >What I want to do is something like
> ><!--#exec cgi="/path/to/script.cgi"-->
> >to embed the script's output or <!--#geoguide-->

> The proper term is "server side include".

SSI implements a rather primitive language, that has nothing to do with
a Perl newsgroup.  Only through the, optionally disabled, exec command
do we get the whole power of Unix, be it Shell, Perl or whatever.

A comparable approach, based on nothing but plain Perl, is my inverse
Perl or iPerl interpreter, which has both a command line frontend for
offline treatment, and a cgi frontend to be activated in a webserver.
The files are plain HTML, with specially marked snippets of Perl, that
can generate output, or control what HTML gets output, potentially in a
loop.

Find the details in http://beam.to/iPerl/

- Daniel

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 03 May 1999 10:34:29 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Exit code question..
Message-Id: <372D5F95.6AE4C53D@gmx.net>

Darren Bennett wrote:
> 
>                         (how can I get around it??)

<tchrist>Install an operating system?</tchrist>

Cheers,
Philip


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

Date: Mon, 3 May 1999 13:53:45 +0200
From: "Joe" <keitgen@keitgen.de>
Subject: GETting a Web-Site with IO::Socket::INET
Message-Id: <7gk2sj$cuq$1@usenet43.supernews.com>

Hello,

I got this far, but I would like to know how I can get the HTML-Code of a
Web-Page and have it be printed or placed in a variable...


Thanks
Joe

#!/usr/bin/perl -w
use IO::Socket;

$url = "http://www.yahoo.com";

$this_socket = IO::Socket::INET->new (PeerAddr => $url,
                                      Timeout  => '9',
                                      PeerPort => 'http(80)',
                                      Proto    => 'tcp');

$get_request = ("GET $url HTTP/1.0\r\n" .
                "Content-type: application/x-www-form-urlencoded\r\n");

$test = $this_socket->print ($get_request);
print $test;





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

Date: 3 May 1999 12:27:01 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: GETting a Web-Site with IO::Socket::INET
Message-Id: <slrn7ir5li.l0r.fl_aggie@stat.fsu.edu>

On Mon, 3 May 1999 13:53:45 +0200, Joe
<keitgen@keitgen.de>, in <7gk2sj$cuq$1@usenet43.supernews.com> wrote:

+ I got this far, but I would like to know how I can get the HTML-Code of a
+ Web-Page and have it be printed or placed in a variable...

        use LWP::Simple;
        $content = get("http://www.sn.no/")

James



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

Date: Mon, 3 May 1999 14:40:30 +0200
From: "Joe" <keitgen@keitgen.de>
Subject: Re: GETting a Web-Site with IO::Socket::INET
Message-Id: <7gk5kl$djn$1@usenet43.supernews.com>

This is too slow for me... It takes for ever on my server....


Joe


I R A Aggie <fl_aggie@thepentagon.com> schrieb in im Newsbeitrag:
slrn7ir5li.l0r.fl_aggie@stat.fsu.edu...
> On Mon, 3 May 1999 13:53:45 +0200, Joe
> <keitgen@keitgen.de>, in <7gk2sj$cuq$1@usenet43.supernews.com> wrote:
>
> + I got this far, but I would like to know how I can get the HTML-Code of
a
> + Web-Page and have it be printed or placed in a variable...
>
>         use LWP::Simple;
>         $content = get("http://www.sn.no/")
>
> James
>




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

Date: Sun, 2 May 1999 23:08:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP: opening files in perl and streaming them to web pages
Message-Id: <MPG.1196dd0c3eeea87d98999f@nntp.hpl.hp.com>

In article <ebohlmanFB55Fx.BvB@netcom.com> on Mon, 3 May 1999 05:19:08 
GMT, Eric Bohlman <ebohlman@netcom.com> says...
> David Efflandt <efflandt@xnet.com> wrote:
> : $len = -s $dfile;	# file size in bytes
> : print "Content-type: application/octet-stream\n";
> : print "Content-length: $len\n\n";	# recommended
> : binmode DFILE;	# you need this for binary files in Windows (not unix)
> 
> You also need to binmode STDOUT.  Note that on Unix, binmode is simply a 
> no-op.
> 
> : print <DFILE>;	# this prints the whole file at once.

As there are no 'lines' in the file, and the whole file is in memory at 
once using that code, why waste time searching for newlines and 
splitting the file into separate arguments for print?

   { local $/; print <DFILE> }

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


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

Date: Mon, 03 May 1999 09:46:21 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: How do i print something using perl?
Message-Id: <372D544D.70D5E20B@gmx.net>

Stephen Warren wrote:
> 
> Well, I had a CPC [...]

Which one? I had a 464 with green monitor and tape drive... always
thought of saving up DM 400 for an external disk drive but never got
around to it. I remember buying a game then giving it to a friend as a
present when I found out you needed to distinguish colours to play the
game (e.g. "hit the guy in the read shirt" -- funny, all the players on
the screen wear green shirts...). The Joyce was my dad's, although I had
the use of it for a couple of years to do my IB "Extended Essay" (ca.
4000 words) on.

Cheers,
Philip


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

Date: Mon, 03 May 1999 08:17:35 GMT
From: jckchan@hotmail.com
Subject: inserting "|" and " ' " to Access????
Message-Id: <7gjm2t$esg$1@nnrp1.dejanews.com>

Dear all

I and trying to write a Form with Perl and pass the data to MS Access.
I am using WIN32::ODBC.
I have problem passing characters such as "|" and " ' ".

Is it possible to pass those characters???
Can I substitute to something so that MS Access knows what it is???

Cheers
Jason

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 3 May 1999 12:18:43 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: inserting "|" and " ' " to Access????
Message-Id: <372d9423.0@news.new-era.net>

jckchan@hotmail.com wrote:
> Dear all

> I and trying to write a Form with Perl and pass the data to MS Access.
> I am using WIN32::ODBC.
> I have problem passing characters such as "|" and " ' ".

> Is it possible to pass those characters???

My company ran into this once. You can double your ' to get a quote passed
through. It took me weeks to discover this; it is not documented. I
did not know there was a problem with |, and have no idea how to pass
it through.

Scott


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

Date: Sun, 02 May 1999 21:44:51 -0500
From: silver <silver@silverchat.com>
Subject: Is this a bug?
Message-Id: <372D0DA3.6197278F@silverchat.com>

9:06:14pm psychodrama:~> cat > bugtest.pl
use Tie::Hash;

tie %tiedhash, 'Tie::StdHash';

my $ref_to_hash = {};
my $ref_to_tiedhash = \%tiedhash;

$ref_to_hash->{'blort'} = 'fnord';
$ref_to_tiedhash->{'foo'} = 'bar';

my $ref_h1 = \$ref_to_hash->{'blort'};
my $ref_h2 = \$ref_to_hash->{'blort'};

my $ref_t1 = \$ref_to_tiedhash->{'foo'};
my $ref_t2 = \$ref_to_tiedhash->{'foo'};

print "normal refs: $ref_h1\n             $ref_h2\n\n"; 
print "  tied refs: $ref_t1\n             $ref_t2\n";

9:06:37pm psychodrama:~> perl bugtest.pl
normal refs: SCALAR(0x80d76f8)
             SCALAR(0x80d76f8)

  tied refs: SCALAR(0x80d7704)
             SCALAR(0x80d7710)

9:17:21pm psychodrama:~> /opt/perl/5.00502/bin/perl bugtest.pl 
normal refs: SCALAR(0x80fd334)
             SCALAR(0x80fd334)

  tied refs: SCALAR(0x80fd340)
             SCALAR(0x80fd358)

C:\My Documents\silver\Perl>perl bugtest.pl
normal refs: SCALAR(0xba57d0)
             SCALAR(0xba57d0)

  tied refs: SCALAR(0xba57e8)
             SCALAR(0xba5818)

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

The behavior of references to hash elements is drastically different
under tied hashes. I can guess _why_ - it seems to fetch the value and
returns a reference to the value, which is probably the easiest thing to
write. Is that a bug, or a feature?

I would think I would want/expect/need tied hashes to act exactly like
regular hashes, even under these odd circumstances, but it would
probably take too much extra bookkeeping to keep the reference "right"
and allow changes to the reference to act as STORE calls to the tied
hash. sigh.

Thanks for reading. Sorry if this has been reported before or is in the
FAQ or something, but I did check the latest copy I could find of
perltie to see if this gotcha was mentioned there (as well as all the
'tie' references in all my o'reilly books and the perlref page).

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

9:06:42pm psychodrama:~> perl -v

This is perl, version 5.003 with EMBED
        built under linux at Aug 19 1996 12:22:38
        + suidperl security patch

9:19:10pm psychodrama:~> /opt/perl/5.00502/bin/perl -v

This is perl, version 5.005_02 built for i586-linux

C:\My Documents\silver\Perl>perl -v

This is perl, version 5.005_02 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)

Binary build 509 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 13:37:15 Jan  5 1999


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

Date: Mon, 03 May 1999 08:06:32 -0400
From: Moorthi Natarajan <vnataraj@ae0181.pd8.ford.com>
Subject: Need help in PERL...
Message-Id: <372D9148.FB019791@ae0181.pd8.ford.com>

Hello PERLERS !!!

I have two perl5 programs.

ProgramA.pl and ProgramB.pl and I am using the "exec" from within
ProgramA.pl to execute ProgramB.pl.  Everything works just fine.

Now, how can I pass scalar(s) and array(s) variable which are created in
ProgramA.pl into the ProgramB.pl.

Restrictions I have is, I am running ProgramA.pl on one host_X and
ProgramB.pl on an another host_Y.  And I have to run these two programs
separately to avoid some system related issues.

Any help is greatly appreciated.

Thanks in advance.

Moorthi Natarajan.


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

Date: Mon, 03 May 1999 10:00:44 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: newbie in need...
Message-Id: <372D57AC.11B80B50@gmx.net>

David Cassell wrote:
> 
> Philip 'Yes, that's my address' Newton wrote:
> >
> > Borland calls their C compiler tcc or bcc. FWIW.
> 
> And I think there's some wacky gcc thing I've heard of somewhere.  :-)

Never heard of it. :)

> Not everyone except M$ calls it cc.

Sorry, couldn't parse that one. Can you explain this sentence to me
again?

Cheers,
Philip
-- 
Don't remove anything to reply, unless you're a spammer.


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

Date: 03 May 1999 01:20:21 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Newsfeed and Local Weather
Message-Id: <yl676afttm.fsf@windlord.stanford.edu>

Kai Henningsen <kaih=7G5oWCd1w-B@khms.westfalen.de> writes:
> rra@stanford.edu (Russ Allbery) writes:

>> I don't think TIMTOWTDI is just a theoretical concept to Larry.

> But 19$Year is *not* a way to do it.

> In fact, it never was.

Wasn't that in the man page, not the script?

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Mon, 03 May 1999 12:34:28 GMT
From: sstarre@my-dejanews.com
Subject: Perl in the workplace
Message-Id: <7gk54k$q9a$1@nnrp1.dejanews.com>




I work for a large Fortune company, where use of Perl is a forbidden
practice. There are two distinct camps - MIS, who mandates that all CGI will
be done in VB-script (ack!), and two, engineers and scientists who use an
ecclectic mix of languages. In my camp (the latter) a small band of us risk
our employment daily and continue to write our CGI in Perl. Proabably less
than 20 people in this company of over 20,000 use Perl. We download it and
install it on our Suns, so largely we're safe from MIS probing which only
(today) extends into the NT and VMS domains.

They argue that as Perl is freely distributed, support isn't guaranteed and
therfore it doesn't meet the corporate standards. In meetings, MIS refers to
Perl jokingly as an avante guarde group of mavericks, unworthy of corporate
consideration (they hold linux the same in the same regard). Ironically, many
times when we ask them to write CGI for us, they tell us that VB SCript can't
do what we're requesting (so we go off and do it in Perl ourselves).

Do others find this kind of resistance to Perl at work? If so, were you able
to make a case to management to at least allow it as a "2nd language"? Have
you had to "go underground" to get your job done?

Cheers,
S

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 03 May 1999 10:04:38 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <372D5896.CAD81CCE@gmx.net>

Ronald van der Lingen wrote:
> 
> Linux is not an option I think. My laptop has a harddisk of 60 MB, so
> there isn't enough space for linux.

It depends on your distribution. I had a Slackware Linux running quite
happily in a 50 MB partition -- no X, of course. However, you need to
get hold of an old kernel/distribution. 2.0.36 will almost certainly be
too big (for both your HD and your RAM).

Cheers,
Philip


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

Date: Mon, 03 May 1999 12:34:32 GMT
From: Vicuna <vicuna@my-dejanews.com>
Subject: remove all chars of a type except first and last.
Message-Id: <7gk54o$q9f$1@nnrp1.dejanews.com>

I need remove all characters of a certain type, except for the first and
last. My solution is ugly so I am looking for better ones, prefer one-liner. 
Mine is especially bad when there are only two ".  Then it is doing the sub
when not needed.  In example below I strip out all " between the first and
last.  The " can appear anywhere in the string, but there will always be at
least two. Often there are only two.  Not homework, corrupted SPSS syntax
files.

TIA
V

Please no email, I read newsgroup only.
-----------

my @lines = ('This is one annoying:"line "that" has stuff to be removed"',
             'This is another annoying:"line "has stuff to be removed"');

foreach (@lines) {
	s/(".*")/my_tr($1)/e;
}

sub my_tr {
	my $in = shift;
	$in =~ tr/"//d;
	return qq("$in");
}

print "$_\n" foreach @lines;

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 03 May 1999 11:34:15 GMT
From: adrianobarenco454@my-dejanews.com
Subject: Runninf external programs from Perl on NT
Message-Id: <7gk1jn$nfb$1@nnrp1.dejanews.com>

Hi,

I am trying to run an external program from perl. I use the system command:

 ...
 system('progname');
 ...

I would like the Perl program to to stop until execution of the external
program is finished. I've read that this is what is supposed to happen.
However, in my case, it seems that perl launches the program and goes
straight to the next instruction.

Is there a way around that?

I am using the activestate port on a NT4 platform.

Any help appreciated.

Adriano Barenco
barenco@yahoo.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 03 May 1999 12:03:59 GMT
From: barenco@yahoo.com
Subject: Running an external program from Perl on NT
Message-Id: <7gk3bf$or3$1@nnrp1.dejanews.com>

Hi,

I am trying to run an external program from Perl. I use the command system:

<...>
system('progname');
<next perl instruction>;

I would like Perl to hang and wait until completion of the external program. I
read that it's what is supposed to happen with 'system()', however on my
computer (NT4.0 with activestate perl), the perl program continues without
waiting the end of the external program.

Any  help is appreciated.

Adriano Barenco

barenco@yahoo.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 03 May 1999 10:23:07 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: sorting data in perl
Message-Id: <7gjsmo$p3s$1@birch.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
cyberunity@my-dejanews.com wrote:
>Hi,
>
>I am a new to PERL and would like to ask the following question:

It's perl and that is still no excuse for posting the same question 
twice under different subject lines!

>If I have an array as follow:
>
>A1    200
>BC    305
>EF    100
>DE    210
>
>and I would like to sort this array so that the output should be like:
>
>EF     100
>A1     200
>DE     210
>BC     305

Check out perlfaq4 "how can I sort an array (by anything).




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

Date: Mon, 03 May 1999 12:14:18 GMT
From: sstarre@my-dejanews.com
Subject: Re: why doesn't redeclaring $i give warning/errors?
Message-Id: <7gk3uo$pat$1@nnrp1.dejanews.com>

Yes, this and the other posters were very helpful, Thank-You. I never
realized that each instance of a loop is considered a "new scope". I don't
think other languages are like that are they? I'll have to tweak my brain a
bit to think in these terms.

THanks again you guys are great!

HUG,
S


In article <37285ec2.1100593@news1.mi.home.net>,
  sweet@enterpriseusa.com (Rob Sweet) wrote:
> You aren't redeclaring $i 5 times in the loop - because each time you
> iterate the loop you re-enter the scope.  This is functionally no
> different than having a sub that delcares my $i and calling it five
> times in a row.
>
> -
>
> Rob Sweet
>
> On Thu, 29 Apr 1999 12:29:19 GMT, sstarre@my-dejanews.com wrote:
>
> >
> >
> >
> >If I try:
> >
> > #!/usr/local/bin/perl -w
> > my $i=0;
> > my $i=1;
> >
> >perl correctly identifies the redeclaration of $i and reports:
> >
> > "my" variable $i masks earlier declaration in same scope at x.pl line 3.
> >
> >however, I can use this without errors or warnings:
> >
> >#!/usr/local/bin/perl -w
> >
> > my $j=0;
> > while ($j<5)
> > {my $i+=++$j;
> >  print "$i\n";
> > }
> > perl x.pl
> > 1
> > 2
> > 3
> > 4
> > 5
> >
> >
> >In which I redeclare $i 5 times. "my" declares the variable scoped for the
> >enclosing brackets; in this case the while loop brackets. So why am I allowed
> >to declare it 5 times in the same scope? It seems like the same case as in
> >the first trial. Also, its a subtle bug as $i is invariant- its redeclared as
> >0 each pass.
> >
> >What I really want of course is more like:
> > my $j=0;
> > my $i=0;
> > while ($j<5)
> > {$j++;
> >  $i+=$j;
> >  print "$i\n";
> > }
> > perl x.pl
> > 1
> > 3
> > 6
> > 10
> > 15
> >
> >But in this case, now I have $i scoped for the entire remainder of the
> >program, which is also not quite what I want, but at least the results are
> >correct.
> >
> >Anyhow, this seems inconsistent. If it warns in trial 1 it should warn in
> >trial 2.
> >
> >HUG,
> >S
> >
> >
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

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

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