[10626] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4218 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 14 01:07:12 1998

Date: Fri, 13 Nov 98 22:00:18 -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           Fri, 13 Nov 1998     Volume: 8 Number: 4218

Today's topics:
        %f - interesting question for non-newbies vis37@my-dejanews.com
        A question about "system" function <zzhang@bayou.uh.edu>
    Re: A question about "system" function <r28629@email.sps.mot.com>
    Re: A question about "system" function <nospam.gear4u@hotmail.com>
        CGI HTML Made even Easier <andretti@cyberspace.org>
    Re: Compiling Perl <randy@stonemarche.org>
    Re: CPAN "r" command is confused? lvirden@cas.org
    Re: Definition of "odd characters" in -T/-B documentati (Tye McQueen)
    Re: Extracting substrings (Patrick Timmins)
        Help on use strict please <rwilliamson@uno.gers.com>
        Help! "dired"-like utility through perl? <kj0@mailcity.com>
        How to access a file within a perl program  (Murali Kanaga)
    Re: Is __DIE__ a real signal? (with real signal limitat <zenin@bawdycaste.org>
    Re: Perl equiv of java showDocument()? <mcgrew@alumni.stanford.org>
    Re: Positional parameter support in perl printf (Larry Rosler)
    Re: Positional parameter support in perl printf <r28629@email.sps.mot.com>
        Printf - interesting for non-newbies vis37@my-dejanews.com
    Re: pwd without backticks? (Bernie Cosell)
    Re: Q: pod inside data structures <zenin@bawdycaste.org>
    Re: SMTP server on the Web smm@mindspring.com
    Re: Sorting Question (Larry Rosler)
    Re: Using Win32::Registry.pm (Tye McQueen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 14 Nov 1998 01:54:12 GMT
From: vis37@my-dejanews.com
Subject: %f - interesting question for non-newbies
Message-Id: <72ins5$91i$1@nnrp1.dejanews.com>

Hello.

Following strings are working fine:
printf("%d",$somevalue);
printf("%.2f",$somevalue);

When page is secured (with certification from VeriSign), a second string
is not working !
I mean, %f, %g, %e - become not working ! But %s, %c, %d, %i...are working !
Why ? Everything other is working (big difficult scripts).

Perl 5.004
Windows NT 4.0
IIS 4.0

Thank you,
Gary.

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


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

Date: Fri, 13 Nov 1998 21:36:45 -0600
From: Zhengdong Zhang <zzhang@bayou.uh.edu>
Subject: A question about "system" function
Message-Id: <364CFACD.2564@bayou.uh.edu>

At the end of a perl program I wrote the following statements:

system "netscape &";
system "gcg &";

After executing the program, Netscape can be invoked but GCG can not.
Shell gives the following error message:

sh: gcg: not found

But if I type in gcg or netscape after the system prompt each of them
can be successfully launched. What makes the difference?


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

Date: Fri, 13 Nov 1998 22:25:15 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Zhengdong Zhang <zzhang@bayou.uh.edu>
Subject: Re: A question about "system" function
Message-Id: <364CF816.489C5065@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Zhengdong Zhang wrote:
> 
> At the end of a perl program I wrote the following statements:
> 
> system "netscape &";
> system "gcg &";
> 
> After executing the program, Netscape can be invoked but GCG can not.
> Shell gives the following error message:
> 
> sh: gcg: not found
> 
> But if I type in gcg or netscape after the system prompt each of them
> can be successfully launched. What makes the difference?

Make sure gcg is not an alias, as system() doesn't see aliases (since it uses sh).

-tk


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

Date: Sat, 14 Nov 1998 00:14:05 -0500
From: sara starre <nospam.gear4u@hotmail.com>
Subject: Re: A question about "system" function
Message-Id: <364D119C.785CC887@hotmail.com>

Hi there Zhengdong :)

you might try system "which gcg"; to see if its in the path. Are you
executing the system call from a cgi script? If so, rememeber that the
 .cshrc isn't invoked, so any ENV or alias' from there are probably not
defined. You may need to fully qualify the path for gcg if it's not
found.

Buena Suerte!

S

Zhengdong Zhang wrote:

> At the end of a perl program I wrote the following statements:
>
> system "netscape &";
> system "gcg &";
>
> After executing the program, Netscape can be invoked but GCG can not.
> Shell gives the following error message:
>
> sh: gcg: not found
>
> But if I type in gcg or netscape after the system prompt each of them
> can be successfully launched. What makes the difference?



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

Date: Fri, 13 Nov 1998 12:40:56 -0600
From: Avelino Andretti Benavides <andretti@cyberspace.org>
Subject: CGI HTML Made even Easier
Message-Id: <364C7D38.ED06DE02@cyberspace.org>

Announcing, yet another library for CGI scripting in PERL.
What does this library has in particular:
	Makes easier your work with designers.
	No more embedding HTML in your code.
	Easy to use.
	Plataform independent.
	Tested, widely.
	Friendly with most Commercial HTML Editors.
	The web designer doesn't seem to have any trouble.
	Can work with plain text file.
	Supports OO-PERL
	Minimalist scripting.
	Embed PERL in HTML hassle free.
	Minnor changes to your current scripts and HTML.
	Easy to implement.
	Reduces production time in 20%
	Reduces explanation and manteinance in 60%
	Reduces hassle and trouble with commercial HTML editors 
		(like MS Front Page) in about 90% (yep)
	FREE.
	Best of all, written in PERL.


How can you get it.
Easy:
	http://www.geocities.com/soho/lofts/6680/perl
	http://www-lce.cem.itesm.mx/~al448482/perl

Had been tested in REAL commercial sites and now in use.
Like 
www.activamente.com.mx
	www.activamente.net.mx
		www.humboldt.edu.mx/circulares
			www.aigmexico.com.mx
				www.burundis.com.mx (now down for remodeling)
100% compatible and ready to use with the world famous cgi-lib

This little marvel is called htmlparser.pl
mini-HOW-TO:
	1. Download.
	2. Make your form.
	3. Make your template(s).
	3. Make your cgi.
	3.1 Parse input (cgi-lib)
	3.2 Do what you must do.
	3.3 Parse output (htmparser.pl)
	3.4 Close your cgi.
	4. Happy end user.
	5. Happy developer.


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

Date: Fri, 13 Nov 1998 20:12:56 -0500
From: "Randy Perryman" <randy@stonemarche.org>
Subject: Re: Compiling Perl
Message-Id: <72ilga$2pf$1@pyrite.mv.net>

I would prefer to compile my own binaries for the various platforms that I
am supporting from one source pool.  It would help to insure that everyone
is on the same codebase.  So if anyone can with the compiling of Perl's
latest pool into WIN32 Iwould appreciate it.

rp
Tom Phoenix wrote in message ...
>On Thu, 12 Nov 1998, Randy Perryman wrote:
>
>> I am trying to compile the stable.zip of perl and my head hurts.  I am
>> not too familiar with the compilers, but I keep getting a syntax error
>> when I try.  I am using Microsofts Visual C++ 5.0 with sp3 applied.
>> Can some one help...
>
>Sure; just download a working binary from CPAN. Cheers!
>
>--
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: 14 Nov 1998 05:28:41 GMT
From: lvirden@cas.org
Subject: Re: CPAN "r" command is confused?
Message-Id: <72j4e9$s1l$1@srv38s4u.cas.org>


According to John G Dobnick <jgd@alpha3.csd.uwm.edu>:
:From article <910770006.301186@thrush.omix.com>, by Zenin
:<zenin@bawdycaste.org>:
:> John G Dobnick <jgd@alpha3.csd.uwm.edu> wrote:
:> 	>snip<
:> : I installed the TK::Pod module, and when I then issue a CPAN "r"
:> : command (to obtain its idea of "reinstallation recommendations")
:> : it tells me the following:
:> :
:> : Package namespace         installed    latest  in CPAN file
:> : Tk::Pod                        3.14      3.14  ACH/Tk-Pod-0.10.tar.gz
:> 

This was just one of the many cases of modules which had weird $VERSION
problems.  In this case, the author jumped right in and fixed things up
once it was pointed out.  Other authors show a wide range of responses
to reports of the problems.  Perhaps a set of standard patches to CPAN
modules so that CPAN.pm work with them could be published.

-- 
<URL:mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL:http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: 13 Nov 1998 23:14:41 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Definition of "odd characters" in -T/-B documentation.
Message-Id: <72j3k1$1ep@fohnix.metronet.com>

Lloyd Zusman <ljz@asfast.com> writes:
) 
) Does this mean that the "non-funny" control characters are these? ...
) 
)    \r  \t  \n  <form-feed>
) 
) Or perhaps this is the criterion? ...
) 
)    /* where isspace() is from ctypes.h ... */
)    if ((!isspace(character) && character < 0x20) ||
)        (character & 0x80) != 0)
)    {
)        /* funny character */
)    }

 ...so you want to know what the code that implements this looks like?...

) And how large is "the first block or so" (quoted from the man page) of
) the file that the `-T/-B' test examines?
[...]
) Well, thank you, but the algorithm is still of interest to me.  My
) requirements in this particular case do not include the need to winnow
) out readable data from utf or wide-character text.  I just want to
) know the specifics of how Perl currently makes its decision in this
) `-T/-B' test.
) 
) Once again ... does anyone know where this might be documented?

In the source code, of course.  ;>  See pp_fttext in pp_sys.c.

Putting the grubby details in the documentation would mean we
couldn't adjust the grubby details when we find an improvement.

At least one implementation of Perl likes to check 512 characters,
thinks \0 is very odd, 8-bit chars are odd, \n \r \b \t \f and \e
are the only non-odd characters below ' '.  (\e is written as 27
since C doesn't understand "\e" like Perl does.)
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Sat, 14 Nov 1998 05:34:50 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Extracting substrings
Message-Id: <72j4pq$jb9$1@nnrp1.dejanews.com>

In article <364CC424.F5C7C6BA@cnd.hp.com>,
  Srikanth Natarajan <nkanth@cnd.hp.com> wrote:

> Hi
>
> I have a sample string like this
>
> !!1%abcdefgh!!2%dfdfddfd!!10%dfdddddd
>
> The number between !! and the % can be anywhere between 1 and 100
> In the above string they are 1,2 and 10
> But in reality it can be anywhere b/w 1 and 100
>
> Now, given this string I want to extract all the numbers in it and
> store them in an array.  The numbers will be stored in the same order
> in which they occur in the string.

while (<DATA>) { while (/!!(\d{1,3})%/g) { push @array, $1; } }
__DATA__
!!1%abcdefgh!!2%dfdfddfd!!10%dfdddddd
etc etc

if there could be numbers between 101 and 999, and you need to exclude
them, then maybe:

while (<DATA>) { while (/!!(\d\d?|100)%/g) { push @array, $1; } }

Patrick Timmins
$monger{Omaha}[0]

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


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

Date: Fri, 13 Nov 1998 20:45:44 -0800
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Help on use strict please
Message-Id: <rT732.42$ay.3805@news.connectnet.com>

I am stumped!
Im trying to establish a variable (in the main routine) whose value will
be readily available to any functions/subroutines that are called. I think I
understand the distinctions between global, my, and local variable
scope, but Im having trouble implementing it when the use strict pragma
is enabled.
The code shown below works as I would expect so long as the use strict
line is commented out. If I uncomment it, I get the following errors:
Global symbol G requires explicit package name at
/home/jeb/transfer/jeb.pl line 3.
Global symbol L requires explicit package name at
/home/jeb/transfer/jeb.pl line 5.
Execution of /home/jeb/transfer/jeb.pl aborted due to compilation errors.
Can either of you point me in the right direction?
Rusty

#!/usr/local/bin/perl
#use strict;
$G = __LINE__ ;
my $M = __LINE__ ;
local $L = __LINE__ ;
print main bef: ;
print G=$G M=$M L=$L\n;
test();
print main aft: ;
print G=$G M=$M L=$L\n;
sub test {
print test bef: ;
print G=$G M=$M L=$L\n;
$G = __LINE__ ; my $M = __LINE__ ;
local $L = __LINE__ ; print test aft: ; print G=$G M=$M L=$L\n;
}
# expected output:
# main bef: G=3 M=4 L=5
# test bef: G=3 M=4 L=5
# test aft: G  M  L
# main aft: G  M=4 L=5







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

Date: 14 Nov 1998 05:56:43 GMT
From: k y n n <kj0@mailcity.com>
Subject: Help! "dired"-like utility through perl?
Message-Id: <72j62r$350@news1.panix.com>
Keywords: dired, curses, interactive tables


Hi.  I'm looking for anything that will help me implement an
"interactive table utility", as found in many applications.  For
example, in emacs there's command, dired, that presents the user with
an interactive table of files, like this:

  /net/u/1/k/kj0:
  total 3892
  drwx------ 12 kj0          4096 Nov 14 00:24 .
  drwxr-xr-x 31 root         4096 Oct 12 10:31 ..
  -rw-------  1 kj0           289 Jul 13 11:35 .cshrc
  -rw-------  1 kj0            87 Jan  6  1998 ta3
  -rw-------  1 kj0          1149 Jul 13 13:02 tomc
  -rw-------  1 kj0             0 Oct 13 12:23 trash
  -rw-------  1 kj0          1844 Oct  6 16:52 wot
  -rw-------  1 kj0          2134 Sep 12 18:51 wrtrs

The table is scrollable and is equipped with a cursor, so that by
placing the cursor on a particular line, and hitting 'd' (for
example), one can mark a file for deletion; when one hits 'x', emacs
asks for confirmation to delete the previously marked files, like
this:

  /net/u/1/k/kj0:
  total 3892
  drwx------ 12 kj0          4096 Nov 14 00:24 .
  drwxr-xr-x 31 root         4096 Oct 12 10:31 ..
  -rw-------  1 kj0           289 Jul 13 11:35 .cshrc
D -rw-------  1 kj0            87 Jan  6  1998 ta3
  -rw-------  1 kj0          1149 Jul 13 13:02 tomc
D -rw-------  1 kj0             0 Oct 13 12:23 trash
  -rw-------  1 kj0          1844 Oct  6 16:52 wot
  -rw-------  1 kj0          2134 Sep 12 18:51 wrtrs

--%*-Dired: ~ ---------------------(Dired by name)--L74--Bot------
ta3    trash

--**-Emacs: *Deletions* ---------(Fundamental)--L1--All-----------
Delete D [2 files] (yes or no)
------------------------------------------------------------------

So, by "interactive table", I mean a scrollable table (one item per
line) with a cursor and a message line at the bottom, and capable of
recognizing a few single-keystroke commands.

I often find myself wanting to use such interactive tables in my perl
scripts, but implementing them seems like a bigger programming task
than I can readily handle.  Given that they are such useful tools, I'm
hoping that perl libraries already exist that implement them, or at
least facilitate their implementation.  Any pointers to useful
code/libraries for this application would be much appreciated.

Thanks in advance,

KJ



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

Date: Fri, 13 Nov 1998 20:35:11 -0800
From: mkanaga@hotmail.com (Murali Kanaga)
Subject: How to access a file within a perl program 
Message-Id: <4M732.11507$C5.6274499@WReNphoon1>


Greetings!

I am new to Perl. I have to write a perl program which will search through
the /etc/group file. When I type a user name (jdoe), the script will go
through
/etc/group file & find out which group jode is in.

In order to do this, how can I read the file /etc/group from my perl script.

I would really apprecitae any idea or input on this.

Thank you,
murali



   -**** Posted from Supernews, Discussions Start Here(tm) ****-
http://www.supernews.com/ - Host to the the World's Discussions & Usenet


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

Date: 14 Nov 1998 00:52:40 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Is __DIE__ a real signal? (with real signal limitations?)
Message-Id: <911004719.657596@thrush.omix.com>

Benjamin Low <b.d.low@unsw.edu.au> wrote:
: Zenin stated:
: > : $SIG{__DIE__} = sub { print STDERR "erk..." };
: > 
: >         Safe.  Just quote the '__DIE__' or use strict won't eat it.

:: I run under strict (and -w) (and agree with Zenin's comments re.
: benefits of -w outwieghing its minor inconveniences). Anyhow, I've found
: perl (5.004) doesn't have any qualms about treating {string} as a string
: - I seem to recall somewhere the docs say as much ...?

	Yes, it does.

: The only time I've found the need to quote is with keywords:
: %h = (
: 	old	=> 'this is ok',
: 	'new'	=> 'have to quote [new]',
: );
: which does look a little messy, so quoting may be aesthetically
: desirable...

	Well, just don't use keywords like that. ;-)
	This is also why some people use -new => 'value', but I've always
	hated that notation with a passion myself.  I'm much more infavor
	of using mixed case starting with upper, like New => 'value', which
	to me looks a lot cleaner then 'new', -new, or later $h{-new}.

	My habit of quoting $SIG{'__DIE__'} came with one of the earlier
	perl5s.  Strict used to think it was a bare word, but in 5.00404
	at least it seems to be ok unquoted.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 14 Nov 1998 01:24:23 GMT
From: Darin McGrew <mcgrew@alumni.stanford.org>
Subject: Re: Perl equiv of java showDocument()?
Message-Id: <72im47$pr0$1@samba.rahul.net>

Bill Chapman  <bchapman@best.com> wrote:
> In Java, there is a routine where you can say "replace the current html
> file with another one right now".[...]
>
> Is there a way to do this in html?  For example, suppose a site moves. 
> Would it be possible to leave an html page at the old place that just
> goes straight to the new site without the user doing anything?

See the answer to the Frequently Asked Question, "How do I redirect someone
to my new page?" <http://www.htmlhelp.org/faq/wdgfaq.htm#27>

In short, the right way to do this is with an HTTP redirection.  The FAQ
answer suggests other alternatives for authors who can't configure their
server to send HTTP redirections.  The fact that you're considering a Perl
(CGI) solution indicates to me that you can probably use HTTP redirections.

> Please cc: me in your reply, ie use "reply all" in Netscape 4.5.

[posted and emailed]
-- 
Darin McGrew, mcgrew@alumni.stanford.org, http://www.rahul.net/mcgrew/

"The man who never makes mistakes never makes much of anything."
                                                     -- Waite Phillips


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

Date: Fri, 13 Nov 1998 17:13:17 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Positional parameter support in perl printf
Message-Id: <MPG.10b67908ba9e3dc989871@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <sarlnlffeq1.fsf@camel.fastserv.com> on 13 Nov 1998 16:46:30 
-0500, Uri Guttman <uri@fastengines.com> says...
> >>>>> "SN" == Srikanth Natarajan <nkanth@cnd.hp.com> writes:
> 
>   SN> I want to know whether the printf in perl supports positional
>   SN> parameters in the format string something like that in C
> 
>   SN> I mean in C printf("%2$d,%1$d\n", a, b) will print b,a
>   SN> and printf("%1$d,%2$d\n", a, b) will print a,b

This is not ANSI/ISO Standard C, but perhaps some non-conforming 
dialects.

>   SN> In perl can I do such stuff?
> 
> why do you need it? perl's printf can do many things C's can't like
> interpolating field sizes in the format string (instead of using * and
> another argument. it is easy to rearrange the args to printf if you need
> to do so, where in C it is a pain.

It actually has a legitimate use, in internationalization (for example, 
via message catalogs).  Often the translated order of outputs wants to 
be different for each locale.

> a way to do that would be an array slice of the args with the positional
> values extracted out of the format string used as the array indices. i
> leave the coding as an exercise to the reader.

Here is a simple example (written in Perl):

    my @time = localtime;
    ++$time[4];
    $time[5] += 1900;
    
    $date = sprintf $format{European}, @time[3, 4, 5];

for enlightened Europeans, or:
    
    $date = sprintf $format{Chinese},  @time[5, 4, 3];

for ISO-standard-conforming Chinese, or:

    $date = sprintf $format{American}, @time[4, 3, 5];

for benighted US'ns.

Extend this to several locales and argument orders, and in Perl it is a 
pain.  The indexes for the array slices would have to be part of the 
locale too.

Using positional parameters, it becomes very simple indeed -- it's all 
in the format.  Who wants to add that to Perl?

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


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

Date: Fri, 13 Nov 1998 22:14:52 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Positional parameter support in perl printf
Message-Id: <364CF5A8.CE366A88@email.sps.mot.com>

Srikanth Natarajan wrote:
> 
> Hi
> 
> I want to know whether the printf in perl supports positional
> parameters in the format string something like that in C
> 
> I mean in C printf("%2$d,%1$d\n", a, b) will print b,a
> and printf("%1$d,%2$d\n", a, b) will print a,b

since when C can do that? new C standard?

In any case, although this is quite common for ex-C/C++ program, you should to
learn to think in Perl. Wouldn't it be easier to just say:

    print "$a is not $b";

-tk


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

Date: Sat, 14 Nov 1998 01:44:19 GMT
From: vis37@my-dejanews.com
Subject: Printf - interesting for non-newbies
Message-Id: <72in9j$8il$1@nnrp1.dejanews.com>

Hello.

I have very simple string:

printf("%.2f",$somevalue);

It is working normally in command string...
It also working under Windows NT, in CGI-script at IIS4 Server.
Sure :)
But when I put my script on secure server (VeriSign), it began not to work !
Just one this string ! Any offers ?

Thank you.

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


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

Date: Sat, 14 Nov 1998 03:38:31 GMT
From: bernie@fantasyfarm.com (Bernie Cosell)
Subject: Re: pwd without backticks?
Message-Id: <364cf6e0.9774869@news.swva.net>

nouser@nohost.nodomain (Thomas) wrote:

} In article <72bajk$29g$1@mathserv.mps.ohio-state.edu> ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
} 
}    >   IZ> Right.  This is why 'pwd' must be suid.
}    > 
}    > wrong. if you got into below strange dir which has only execute perms,
}    > you should know where you are. as i said on solaris, pwd is not suid.
} 
}    This is a bug of Solaris's pwd.
} 
} I have used all the BSD releases (VAX, PDP), most of the SunOS and
} Solaris releases, IRIX, AIX, Linux, and a few others, and I have never
} seen pwd to be suid.  In fact, many shells now have it as a built-in.

Sorry to take this thread even -farther- off the track for Perl matters,
but there's a subtlety that needs to be aired here: there are two different
notions on Unix of the "current directory".  One is the path given in the
last "chdir" call; the other is the -actual- [hard] path to the cwd
starting from the true root directory.  The place where those show up as
different appears strikingly when you do a "cd .." and discover that it is
an artifact of your shell [and so anything you do -outside- the shell will
get you strange results].

For example, on my system I do [just using shell cmds for the example]:
     > cd /tmp
     > pwd
     /tmp
     > /bin/pwd
     /data/tmp
     > ls ..
     apache billing home dpec ... etc
     > cd ..; ls
     bin boot bru data dev etc home lib ... etc

Moral: To the extent that you can, *NEVER* rely on the shell's internal
notion of CWD to figure out where you are.  -nothing- except the _shell's_
cd/pwd pair know about that "private" version of the CWD.  If you're going
to be doing opens, low-level "chdir" calls or anything like that, working
in Perl or anything like that you'll be moving around in the -real- file
system and should only worry about it.  I thought it was a bad idea years
and years ago when they first put the notion of 'current directory' into
the shell, and I think it is still a bad idea now...

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: 14 Nov 1998 01:04:19 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Q: pod inside data structures
Message-Id: <911005417.826961@thrush.omix.com>

Uri Guttman <uri@fastengines.com> wrote:
: i was under the impression that you can put pod whereever comments can go. 

	Nope, you can't stick them inside statements. -I really wish you
	could.

	>snip<
: i want to document my data table of tests in pod since it will describe
: the tests that can be performed. it would be nice to have each test with
: its own pod next to it. the table is just a hash of hashes but i want a
: pod paragraph and head2 before each top level hash.
:
: any ideas?

	I often do something like this:

	my %hash;
	
	=head2 foo
	
	Some comments about 'foo'
	
	=cut
	
	$hash{foo} = {
	    this => 'that',
	};
	
	=head2 bar
	
	Some bar coments
	
	=cut
	
	$hash{bar} = {
	    bar => 'baz',
	};
	
	__END__
	
	etc..

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Sat, 14 Nov 1998 03:10:01 GMT
From: smm@mindspring.com
Subject: Re: SMTP server on the Web
Message-Id: <72isa9$cot$1@nnrp1.dejanews.com>


>>I know this is probably a stupid question, but I am going to ask it anyhow.
>>
>>Is there somewhere on the new an SMTP server that lets anyone use is as an
>>email gateway?
>
>Don't know but if you installed unix you'd have one for free.

I already know that, but since I don't always control what my
corporation/customers use I can't really do. If you worked in a corporate
environment, you would probably ask that question before blurting out
nonsense.

>
> >I would like to test some of the Matt's Scripts that use smtp.
>
> Lots of people don't think much of those. Why not learn Perl?
I know Perl enough to build it, but sometimes leveraging what someone else has
done, even if it's not good enough will do. Lots of people don't think much of
Windows, but millions of people still use it, bugs an all. Myself included.


Steve M




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


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

Date: Fri, 13 Nov 1998 17:38:12 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Sorting Question
Message-Id: <MPG.10b67edbd30ef285989872@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <72if7r$237$1@nnrp1.dejanews.com> on Fri, 13 Nov 1998 
23:26:51 GMT, supradave@earthlink.net <supradave@earthlink.net> says...
> I am trying to sort a file that is multiple line records and needs to be
> sorted on a particular line.  My data looks something like this and I want to
> sort on last:
> 
> first=Barney
> last=Rubble
> phone=234-234-2345
> 
> first=Fred
> last=Flintstone
> phone=123-123-1234
> 
> etc.
> 
> I begin with opening a file and reading it into an array.
> 
> while(<T>) {
>         chop;
>         @list = split(/\n/);
> }
> 
> @sorted = map $_->[0],
>           sort { $a->[1] <=> $b->[1] }
>           map { [ $_, /(\d+)/ ] } @list;
> 
> I then try to do the above and I'm not sure that I understand what is
> happening there.

I recognize what you pasted there.  (I posted it a few days ago.)  You 
cannot use these things without understanding them.  The code shown 
above extracts a number from each record, and sorts numerically.  This 
is *not* what you want.

> Then I do a foreach(@sorted){print;} and I get the last line.
> 
> I have been trying to find examples on the Usenet, but nothing I can find
> referring to multiple line records.
> 
> Can I read 4 lines into the array at 1 time and then sort based on
> @list[last]?

You should read *records* into the array, where in your case a record is 
defined as being terminated by an empty line.  The 
$INPUT_RECORD_SEPARATOR $/ is your friend.

The following code does what you want, and has the added benefit of 
doing a secondary sort on the first name if the last names are the same.  
But *please* try to understand it before blindly using it.  (One 
exercise you might do is to fix where it sorts a last name like "de 
Soto" relative to the others.  Hint -- it can be done by adding four 
letters, and two spaces if you like readability.)

#!perl -w
use strict;

my @list;
{ local $/ = "\n\n"; @list = <DATA> }

my @sorted = map $_->[0],
    sort { $a->[1] cmp $b->[1] || $a->[0] cmp $b->[0] }
    map { [ $_, /\nlast=(.+)/ ] } @list;

print @sorted;
__END__
first=Barney
last=Rubble
phone=234-234-2345

first=Wilma
last=Flintstone
phone=123-123-1234

first=Ferdinand
last=de Soto
phone=987-654-3210

first=Fred
last=Flintstone
phone=123-123-1234

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


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

Date: 13 Nov 1998 18:51:13 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Using Win32::Registry.pm
Message-Id: <72ik61$qse@fohnix.metronet.com>

keydet89@yahoo.com writes:
) I have installed the Win32::Registry.pm module on my
) system...NT 4.0 using ActiveState build 506.  I have
) been working with the examples from LeBerre's site,
) and I can't get the OpenEx() function to work.  I keep
) getting the error:
) "Undefined subroutine &Win32::RegOpenKeyEx called at
) C:\Perl\site\lib/Win32/Registry.pm line 206."
) 
) What is the fix for this?

Probably you have an old version.  I suggest you get libwin32
fom CPAN and use Win32API::Registry or Win32::TieRegistry
which have at least the following advantages over Win32::Registry:

    Complete documentation (as opposed to nearly none).
    Cleaner design.
    Reason for failures available via $^E or similar (not discarded).
    Version numbered so can tell if you have an old version.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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