[11681] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5281 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 1 21:04:38 1999

Date: Thu, 1 Apr 99 18:00:16 -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, 1 Apr 1999     Volume: 8 Number: 5281

Today's topics:
        Can you return hashes in subroutines? (Krusty276)
    Re: Can you return hashes in subroutines? <jglascoe@giss.nasa.gov>
    Re: constructing a list of hashes <jglascoe@giss.nasa.gov>
    Re: constructing a list of hashes <jglascoe@giss.nasa.gov>
    Re: constructing a list of hashes <hojo@i-tel.com>
    Re: constructing a list of hashes (Larry Rosler)
    Re: Easy(?) Riddle <emschwar@rmi.net>
    Re: Easy(?) Riddle Don.Carlton@Citadel.edu
    Re: Nothing returned from system call backticks <jglascoe@giss.nasa.gov>
        Perl 5.005: Maintenance update 03 is available <gbarr@pobox.com>
    Re: quick question... (Tad McClellan)
        Reading a line (Tobias Weihmann)
    Re: Reading a line <gala@sonic.net>
    Re: Sendmail errors to ME and not the SERVER admin <myoptik@yahoo.com>
    Re: Server Side Includes <myoptik@yahoo.com>
        simple HTTP_REFERER script? <optic@city-net.com>
    Re: two questions need help (Tad McClellan)
    Re: Why is this if stmt matching every file? (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 2 Apr 1999 01:08:01 GMT
From: krusty276@aol.com (Krusty276)
Subject: Can you return hashes in subroutines?
Message-Id: <19990401200801.06059.00000981@ng101.aol.com>

I'm having mad problems.  Like I say:

%get_hash_value= &sub_make_hash(@some_list);

sub sub_make_hash{
  (local %return_this_hash);
  XXXXX(all function making %return_this_hash )

  return (%return_this_hash);
}

When I do this I get nothing back for get_hash_value.
but in the main part I can get the values for %return_this_hash, if I use that
name, but I declared it local to the subroutine. 
Are hashes always global.  
This is Perl5, active Perl for win32

Dan
dan@kachinanet.com


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

Date: Thu, 01 Apr 1999 20:35:00 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Krusty276 <krusty276@aol.com>
Subject: Re: Can you return hashes in subroutines?
Message-Id: <37041EC4.13BCB9F9@giss.nasa.gov>

Krusty276 wrote:
> 
> I'm having mad problems.  <snip>

the way to go here is to use references.
These can be confusing critters, but you'll
need to use them eventually.

perldoc perlref

> %get_hash_value= &sub_make_hash(@some_list);

my $hash_ref = make_hash(\@array);

sub make_hash {
    my $array_ref = shift;
    # non-trivial, but silly  ;^)
    my %hash = @$array_ref;
    return \%hash;
}

# example
my @array = ("one", 1, "two", 2);
my %hash = %{ make_hash(\@array) };

use Data::Dumper;
print Dumper \%hash;

	Jay Glascoe


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

Date: Thu, 01 Apr 1999 18:54:59 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: hojo <hojo@i-tel.com>
Subject: Re: constructing a list of hashes
Message-Id: <37040753.1965F145@giss.nasa.gov>

[courtesy copy of post sent to cited author]

hojo wrote:
> 
> so the code is counting the cccodes like so:
>       #[cc]{ccccode}
> $record[81]{27}++; (plus plus if you are seeing little boxxes)  what the hell?
> $record[81]{27}++;
> $record[81]{01}++; and so on
> 
> So, if I run this for the first time, the value in $record[81]{27} is null.

"undefined" you mean.  "null" is a C-ism (or is that "NULL"?)  ;^)

> and it complains about plus-plusing and null.  Without specifiying each
> key/value how can I set the value to a 0 rather than a null?

# if the value is false (undef, 0, "", etc.), then set it to zero
$record[81]{27} ||= 0;

> Is it possible or am I just being lazy?

# perform this initialization "en masse"
# (only makes sense if you know the "shape"
# of your data structure to begin with).
foreach my $rec (@record) {
    $_ = 0 foreach values %$rec;
}


	Jay Glascoe


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

Date: Thu, 01 Apr 1999 19:02:26 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
Subject: Re: constructing a list of hashes
Message-Id: <37040912.70A57824@giss.nasa.gov>

Jay Glascoe wrote:
> 
> # if the value is false (undef, 0, "", etc.), then set it to zero
> $record[81]{27} ||= 0;

wait.  Larry's right: perl doesn't complain
about this at all (although Python would have a
heart attack  ;^)

$ cat try.pl
use strict;
my @record = ();
$record[81]{27}++;
print $record[81]{27}, "\n";
__END__

I tried perl5.005_55, perl5.005_02, perl5.004, and perl5.003


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

Date: Fri, 02 Apr 1999 00:12:28 GMT
From: hojo <hojo@i-tel.com>
Subject: Re: constructing a list of hashes
Message-Id: <7e1215$5vh$1@nnrp1.dejanews.com>

Allow me to correct my statements.  The program works.	With the -wT on it
states the following: Use of uninitialized value at ./p1 line 15. It
complains, but runs anyway.  I really asked the question in the interests of
clean programming.  Thanks.

In article <7e0s2m$h7$1@nnrp1.dejanews.com>,
  hojo <hojo@i-tel.com> wrote:
> I am setting up a list of hashes and would like to know if I can somehow
> initialize the hash values to a 0 (the numeric value) straight out.  I would
> like to do this because the hash is just counting each time a particular
> instance occurs.  Here is an example:
>
> my @record;  #the list
> my $new = {}; #my anon hash
> ---
> a record pops up like this
> cc|cccode    #country code|call completion code
> 81|27
> 81|27
> 81|01
> 82|03
> 81|27
> ...
>
> so the code is counting the cccodes like so:
>       #[cc]{ccccode}
> $record[81]{27}++; (plus plus if you are seeing little boxxes)  what the hell?
> $record[81]{27}++;
> $record[81]{01}++; and so on
>
> So, if I run this for the first time, the value in $record[81]{27} is null.
> and it complains about plus-plusing and null.  Without specifiying each
> key/value how can I set the value to a 0 rather than a null?
>
> Is it possible or am I just being lazy?
>
> =-=-=-=-=-=-=-=-=-=
> David Hajoglou
> Sys. Admin., Abbreviator
> =-=-=-=-=-=-=-=-=-=
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

=-=-=-=-=-=-=-=-=-=
David Hajoglou
Sys. Admin., Abbreviator
=-=-=-=-=-=-=-=-=-=

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


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

Date: Thu, 1 Apr 1999 17:24:24 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: constructing a list of hashes
Message-Id: <MPG.116dbc1b8e837010989815@nntp.hpl.hp.com>

In article <7e1215$5vh$1@nnrp1.dejanews.com> on Fri, 02 Apr 1999 
00:12:28 GMT, hojo <hojo@i-tel.com >says...
> Allow me to correct my statements.  The program works.	With the -wT on it
> states the following: Use of uninitialized value at ./p1 line 15. It
> complains, but runs anyway.  I really asked the question in the interests of
> clean programming.  Thanks.

It doesn't complain with my test program, which was also run with -w 
(and I just added -T, though that is irrelevant).  How can we confirm 
your report about a warning on line 15 without your posting the entire 
program, as I suggested earlier.  Also, what version are you running 
(perl -v)?

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


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

Date: 01 Apr 1999 16:58:05 -0700
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Easy(?) Riddle
Message-Id: <xkfvhffao6q.fsf@valdemar.col.hp.com>

"Adam" <ajones@buildandcompare.com> writes:
> $var1 = "$5.99";
          ^     ^
> $var1 =~ /\$(.*)/;
> print "The price for the nick nack is \$$1 ";

<snip>

> Q:  How come I get a blank price when I match against the dollar sign, but
> number with the "Z"?

Look at those double quotes.  You know what happens in double-quotes,
don't you?  (Hint: you're taking advantage of that very thing to print
out the price in the third line of your example code.)

> Am I escaping things correctly?

Nope.  From perldata:

  String literals are usually delimited by either single or double
  quotes.  They work much like shell quotes: double-quoted string
  literals are subject to backslash and variable substitution; single-
  quoted strings are not (except for "\'" and "\\").  

-=Eric


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

Date: Fri, 02 Apr 1999 00:34:10 GMT
From: Don.Carlton@Citadel.edu
Subject: Re: Easy(?) Riddle
Message-Id: <7e13a2$6uk$1@nnrp1.dejanews.com>

In article <7e0ur7$srd$1@news1.sirius.com>,
  "Adam" <ajones@buildandcompare.com> wrote:
> A seemingly easy problem, my code:
>
> #############################################
>
> $var1 = "$5.99";
Try changing the " to ' so that it does not go through interpolation
  $var1 = '$5.99';

>
> $var1 =~ /\$(.*)/;
> print "The price for the nick nack is \$$1 ";
>
> #############################################
>
> when I run it I get:
>
> "The price of the nick nack is $ "
>
> When I exchange the "$" in the code/regexp for a "Z" I get
>
> "The price for the nick nack is $5.99"
>
> Q:  How come I get a blank price when I match against the dollar sign, but
> number with the "Z"?
> Am I escaping things correctly?
>
> Thanks,
> Adam
>
>

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


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

Date: Thu, 01 Apr 1999 20:41:17 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
Subject: Re: Nothing returned from system call backticks
Message-Id: <3704203D.14067661@giss.nasa.gov>

Joe Blow wrote:
> 
> Sometimes, when I use backticks to run a system command, I get nothing
> back (even though I should):
> 
> For example:
> 
> $ls_result = `ls /etc`;

you could try a pipe:

open PIPE, "/bin/ls /etc |" or die "can't open pipe: $!";
my @result_list = <PIPE>;
close PIPE or die "pipe failed: $!";

> If I put the code in a loop, $ls_results would eventually get set properly:

desperate times require desperate measures  ;^)

	Jay Glascoe


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

Date: Fri, 02 Apr 1999 00:42:08 GMT
From: Graham Barr <gbarr@pobox.com>
Subject: Perl 5.005: Maintenance update 03 is available
Message-Id: <AnUM2.5189$fb4.6767@news2.giganews.com>

The third maintenance update for Perl 5.005 was released on March 28 1999,
and is now available from the Comprehensive Perl Network Archive (CPAN)
sites worldwide.  To select from a list of sites, go to:

    http://www.perl.com/CPAN

Note the absence of a trailing `/'.  The actual file can be found at:

    http://www.perl.com/CPAN/authors/id/GBARR/perl5.005_03.tar.gz

This release is binary compatible with previous 5.005 releases.

For a brief overview of what is new in the 5.005 series and other
important information about reporting problems, see the release
announcement for 5.005:

    http://www.perl.com/CPAN/authors/id/GSAR/perl5.005.announce

More detailed information on changes can be found in "pod/perldelta.pod"
and "Changes" files in the distribution.

WARNING:  Perl 5.005 and later are NOT BINARY COMPATIBILE with releases
prior to 5.005.  You will need to recompile all extensions that require
a C compiler to build (i.e. those that contain XSUBs).  See the
"INSTALL" document for detailed instructions on how to cope.

If you like the spirit in which Perl is made, help cultivate that spirit.
Reveal the sources!  Set knowledge free!


--The Perl Porters

----------------------------------------------------------------------------
SUMMARY OF CHANGES IN MAINTENANCE UPDATE 3
----------------------------------------------------------------------------


CONFIGURATION CHANGES

    Possible to Configure so that installperl skips installing
    Perl into /usr/bin/perl (Configure -Uinstallusrbinperl)

NEW PLATFORM SUPPORT

    DYNIX/ptx: a high-availability UNIX variant from Sequent
    Computer Systems, http://www.sequent.com/

    GNU/Hurd: the GNU Project's replacement for UNIX kernel,
    http://www.gnu.org/software/hurd/hurd.html

    MiNT: an operating system extension that adds UNIX-like
    features to ATARI TOS.  Originally available only for
    m68k-based microcomputers sold by ATARI in the 80's
    but later available also for Mac and VME boards.
    More information available from
    http://www.modeemi.cs.tut.fi/~puujalka/mint.html

    Stratus VOS: a fault-tolerant OS from Stratus Computer,
    http://www.stratus.com/

    U/WIN: a UNIX compatibility environment for Windows NT,
    available from AT&T, http://www.research.att.com/sw/tools/uwin/

PLATFORM ENHANCEMENTS

    BeOS:     	  dynamic loading now supported (tested only on
                  BeOS R4 x86).

    SCO:      	  dynamic linking now supported.

    Linux: 	  now works with installations that have only installed
	   	  "runtime" versions (as opposed to "developer" versions)
		  of some libraries such as GDBM.

    FreeBSD: 	  4.0 supported.  ELF executable format supported.

    NetBSD: 	  those platforms that support shared libraries
            	  have the support now also in Perl.

    OpenSTEP 4.2: i386 machines are now better supported.

    NextSTEP: 	  SysV IPC (from ftp://ftp.nluug.nl/pub/comp/next/SysVIPC/)
              	  now supported.

    Win32: 	  sysread() and syswrite() now work on sockets.
           	  rename() works across drive boundaries on Windows NT and
		  is generally more compatible with its semantics on Unix.

    OS/2: 	  Numerous patches.

    EBCDIC: 	  Character class ranges ([a-z]) now work in non-ASCII
    		  platforms.

NEW MODULES

    Dumpvalue   Perl5 module replacement for old perl4 dumpvar.pl

UPDATED MODULES

    CPAN                1.48

    CGI                 2.46

    Data::Dumper        2.101

    Getopt::Long        2.19

    DB_File             1.65
    
    Test		1.122

    Benchmark           timesum() method added.
                        Can also run tests until N seconds.

    Config              $Config{sig_num_init} now contains
                        the signal numbers corresponding to
                        the signal names of $Config{sig_name_init}.

    Math::Complex       0**0 is now 1, not undefined.

    Math::Trig          Radial/spherical trigonometry functions added.

    Pod::Html           Locale-aware which e.g. means that =headN
                        can contain non-ASCII alphabetic characters.

    Pod::Text           Ditto.

    Carp                Added cluck() - warns with stacktrace

    MakeMaker           PL_FILES now supports multiple targets from a single
                        source

    AutoSplit           fixed to know that pod starts with /^=\w+/
                        (not just /^=/)

    FindBin             now works correctly with Win32 UNC pathnames

NEW DOCUMENTATION

    perlreftut  Tutorial on references.

    perlopentut Tutorial on open().

    perlthrtut  Tutorial on threads.

UPDATED DOCUMENTATION

    All Perl FAQs.

    Many typos fixed in the documentation of core modules.

    perlport    1.39

ENHANCED FUNCTIONS

    sort $coderef @array now works.

    sort() now respects overloading.

    If /dev/urandom is available as a source of random bits,
    Perl will use it automatically to seed the random number generator.
    Note: /dev/random is not used by default because it
    may block if not enough entropy is available.
    If you prefer Perl to block in such circumstances,
    you can compile Perl with -DPERL_RANDOM_DEVICE=\"/dev/random\".
    
    pack/unpack now support Z for null terminated ascii strings
    that are null padded

CHANGED BEHAVIOUR

    Better CR-handling on #! line and in formats.

    Overload syntax is no longer experimental.

    The LENGTH argument to syswrite() is now optional.

ENHANCED UTILITIES

    h2ph is now much more robust.

BUG FIXES

    Many multi-threading fixes. But multi-threading is still considered
    experimental.

    Work around a bug in Digital UNIX C compiler that caused
    the 'x' operator to produce garbage under certain circumstances.
    (This bug caused e.g. the tests of Digest::MD5 to fail.)

    The "Used only once" warning will now only be output once for each
    variable.

    With $/ set to undef, slurping an empty file returns a string of
    zero length (instead of undef, as it used to) for the first time the
    HANDLE is read.  Subsequent reads yield undef.

    $a and $b are only exempt from warnings if sort with a user specified
    subroutine has been seen.

SECURITY FIXES

    Setuid scripts from nosuid mounted filesystems now rejected.

    POSIX::strftime() buffer overflow avoided.


KNOWN PROBLEMS

    lib/anydbm...FAILED at test 12

        This test failure commonly encountered on glibc-2.1 systems where
        db won't accept a null key.

    ULTRIX /bin/sh
    
        Configure cannot be run on ULTRIX with /bin/sh, use sh5 instead.

    OS2 threads

        On OS2 the use of threads, socket and fork together causes a panic.

    sfio
    
        If perl is compiled with sfio op/die_exit.t fails all tests.

----------------------------------------------------------------------------
TESTED PLATFORMS
----------------------------------------------------------------------------

This release is known to build and pass all tests (with some noted
exceptions) on the following platforms:


    PLATFORM                    CC              OPTIONS
    --------                    --              -------

    AIX 4.2.1.0                 cc      
    AIX 4.2.1.0                 cc              -Doptimize=-O
    AIX 4.2.1.0                 cc_r            -Dusethreads
    AIX 4.2.1.0                 gcc 2.8.1
    AIX 4.1.5                   cc              -ders
    AIX 4.1.5                   xlc_r           -Dusethreads -ders
    alpha-dec_osf 4.0           cc      
    alpha-dec_osf 4.0           cc              -Dusethreads
    alpha-dec_osf 4.0           gcc 2.8.1
    alpha-dec_osf 5.0           cc      
    alpha-dec_osf 5.0           cc              -Dusethreads
    AT386-gnu i386 0.2          egcs-1.1.1
    AViiON-dgux r4.11mu02       gcc 2.6.3
    CRAY_J90-unicos 10.0.0.2    cc      
    Debian Linux 2.1            gcc 2.7.2.3     -ders -Dusethreads
                                                     -Doptimize=-g
    Digital UNIX 4.0D           cc              -ders
    Digital UNIX 4.0D           cc              -Dusethreads -ders
    Digital UNIX 4.0E           cc              -ders
    Digital UNIX 4.0E           cc              -Dusethreads -ders
    dynixptx i386 4.2.1         cc      
    FreeBSD i386 2.2.7-release  gcc 2.7.2.1
    FreeBSD i386 2.2.8-release  gcc 2.7.2.1
    FreeBSD i386 2.2.8-release  gcc 2.7.2.1     -Dusethreads
    FreeBSD i386 3.0-stable     gcc 2.7.2.1
    FreeBSD i386 3.0-stable     gcc 2.7.2.1     -Dusethreads
    FreeBSD i386 3.1-stable     gcc 2.7.2.1
    FreeBSD i386 3.1-stable     gcc 2.7.2.1     -Dusethreads
    FreeBSD i386 4.0-current    gcc 2.7.2.1
    FreeBSD i386 4.0-current    gcc 2.7.2.1     -Dusethreads
    HP-UX 11.0                  cc              -ders
    HP-UX 11.0                  cc              -Dusethreads -ders
    IP22-irix 5                 cc      
    IP32-irix 6.5               gcc 2.8.1
    IP32-irix 6.5               gcc 2.8.1       -Dusethreads
    IRIX 6.5                    cc              -ders
    IRIX 6.5                    cc              -Dusethreads -ders
    Linux i386 2.0.36           gcc 2.7.2.3
    Linux i386 2.0.36           gcc 2.7.2.3     -Dusethreads
    Linux i486 1.2.13           gcc 2.7.2.2
    Linux i586 2.2.0-pre2       gcc 2.7.2.3     -Dusethreads
    Linux i586 2.2.5            gcc 2.7.2.3
    Linux i586 2.2.5            gcc 2.7.2.3     -Dusethreads
    Linux i686 2.0.32           gcc 2.8.1
    Linux i686 2.0.36           egcs-1.1.1
    Linux i686 2.0.36           gcc 2.7.2.3
    Linux i686 2.0.36           gcc 2.7.2.3
    Linux i686 2.0.36           gcc 2.7.2.3     -Dusethreads
    Linux ppc 2.2.1             egcs-1.1.2
    Linux ppc 2.2.1             egcs-1.1.2      -Dusethreads
    machten powerpc 4.1.1       gcc 2.8.1
    NetBSD i386 1.3k            egcs-1.1.1
    NetBSD i386 1.3.2           gcc 2.7.2.2     -ders
    NetBSD mac68k 1.3k          egcs-1.1.1
    NetBSD macppc 1.3k          egcs-1.1.1
    NetBSD sparc 1.3.3          gcc 2.7.2.2+myc1
    Next OpenStep Mach          cc
    OpenBSD 2.5                 gcc 2.8.1
    OpenVMS Alpha 7.1           Dec C 6.0
    OpenVMS Alpha 7.1           Dec C 6.0       -Dusethreads
    OS2 2.30                    gcc 2.8.1
    OS390 05.00                 c89     
    OS390 06.00                 c89     
    PA-RISC2.0 11.00            egcs-1.1.2
    PA-RISC2.0 11.00            egcs-1.1.2      -Dusethreads
    powerux ppc 4.3             /bin/cc 
    RM400-svr4                  /bin/cc -W0     
    sco i386 3.2v5.0.4          cc      
    Solaris 2.3                 gcc 2.4.5
    Solaris 2.5.1               gcc 2.7.2
    Solaris 2.5.1               gcc 2.8.1
    Solaris 2.5.1               gcc 2.8.1       -Dusethreads
    Solaris 2.6                 gcc 2.7.2.3     -ders
    Solaris 2.6                 gcc 2.8.1
    Solaris 2.6                 gcc 2.8.1       -Dcc=gcc -ders
    Solaris 2.6                 gcc 2.8.1       -Dcc=gcc -Dusethreads -ders
    Solaris 2.6                 cc         
    Solaris 2.6                 egcs-1.1.1
    Solaris 2.6                 egcs-1.1.1      -Dusethreads
    Solaris 2.6                 gcc 2.8.1
    Solaris 2.7                 egcs-1.1.2
    Solaris 2.7                 SC5.0
    SunOS 4.1.3                 gcc 2.8.1
    SunOS 4.1.3_u1              gcc 2.8.1
    SunOS 4.1.4                 egcs-1.1.2
    svr4 i386                   /bin/cc 
    UNICOS 9.0.1ai              cc              -ders
    Windows NT 4.0              Borland 5.02    -DUSE_THREADS
    Windows NT 4.0              Borland 5.02    Debug
    Windows NT 4.0              Borland 5.02    Debug -DPERL_OBJECT -DPERLCRT
    Windows NT 4.0              VC 5.0          -DPERL_OBJECT -DPERLCRT
    Windows NT 4.0              VC 5.0          Debug -DUSE_THREADS
                                                    -DPERL_MALLOC
    Windows NT 4.0              VC 5.0          none
    Windows NT 4.0              VC 6.0          -DPERLCRT Optimise



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

Date: Thu, 1 Apr 1999 14:10:13 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: quick question...
Message-Id: <lag0e7.afb.ln@magna.metronet.com>

apple (jearanai@my-dejanews.com) wrote:
: In article <37037504.17425DB8@datenrevision.de>,
:   Philip Newton <Philip.Newton@datenrevision.de> wrote:

: > You asked that question already. Don't expect answers in 5 minutes.
: > Usenet rewards patience. (And comp.lang.perl.misc rewards reading the
: > docs.)


: Sorry for making you read twice. I am new in this website 


   This is not a website (HTTP).

   It is a Usenet newsgroup (NNTP).

   Usenet was started in 1979, a good bit before the WWW was
   even invented...


: and new for a
: computer user so I am very appreciated your suggestion. 


   If you want to play in the Usenet sandbox, you will have a much
   better experience if you can pick up some of its culture.

   You can do this by reading some of the articles posted 
   to this newsgroup:


      news.announce.newusers


: For my reason, I
: don't want to bother you with my second message but I did misspelled in my
: first message like this "usong". Thus, I rephrased the second one just for
: make sure that everyone can know it. It didn't mean that I want to trick you.


   It is possible to cancel Usenet posts if you want to "take back"
   something that you said.

   Ask your access provider about how to do that in case you make
   another mistake in the future.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 02 Apr 99 00:49:36 GMT
From: epyx.cjb.net@t-online.de (Tobias Weihmann)
Subject: Reading a line
Message-Id: <7e1471$gfj$1@news03.btx.dtag.de>

Hello,
I am new to perl and would like to know if there is an
easier way of reading lines from STDIN than to use
the module Term::ReadKey as I do currently. 
Thanks in advance for any help!

Tobias


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

Date: Thu, 1 Apr 1999 17:47:00 -0800
From: "Gala Grant" <gala@sonic.net>
Subject: Re: Reading a line
Message-Id: <7e17ep$rr6$1@ultra.sonic.net>

$line = <STDIN>;

Tobias Weihmann <epyx.cjb.net@t-online.de> wrote in message
news:7e1471$gfj$1@news03.btx.dtag.de...
> Hello,
> I am new to perl and would like to know if there is an
> easier way of reading lines from STDIN than to use
> the module Term::ReadKey as I do currently.
> Thanks in advance for any help!
>
> Tobias




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

Date: Thu, 1 Apr 1999 17:53:30 -0800
From: "Shawn Redman" <myoptik@yahoo.com>
Subject: Re: Sendmail errors to ME and not the SERVER admin
Message-Id: <3703fa72.0@nemo.idirect.com>

Benne <benne@village.uunet.be> wrote in message
news:7du85o$33g$1@nickel.uunet.be...
> When I send a newsletter to all my subscribers, my SERVER admin gets the
> error messages for the e-mails that not could be delivered. (wrong email)
He
> has to forward these by hand back to me.
>
> How can I make "sendmail" to send error messages directly to my email
> address and not the server?
>
> $mailprog = '/bin/sendmail -t';
>

try this:

open(MAIL, "| /usr/lib/sendmail -t");
print MAIL "To: $form{'email'} ($form{'name'})\n";
print MAIL "From: [YOUR ADDRESS HERE]\n";
print MAIL "Subject: Does this answer your question?\n\n";
print MAIL "I think the problem rests with the server not knowing\n";
print MAIL "the correct 'return address'. So specifying the From:\n";
print MAIL "should correct the problem.\n\n";
print MAIL "Hope this helps\n";
close(MAIL);




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

Date: Thu, 1 Apr 1999 17:33:15 -0800
From: "Shawn Redman" <myoptik@yahoo.com>
Subject: Re: Server Side Includes
Message-Id: <3703fa56.0@nemo.idirect.com>

> Why does the folowing code not work:
> <!--#exec cgi="http://www.xyz.com/cgi-bin/script.pl"-->
> <!--#include virtual="http://www.xyz.com/cgi-bin/script.pl"-->
> but this works fine:
> <!--#exec cgi="cgi-bin/script.pl"-->
> <!--#include virtual="cgi-bin/script.pl"-->
> Isnt it possible to start scripts on other servers?
> Or, how to do so?

Hi. I'm just starting out myself, so please don't quote me.

   I just read that most systems create an 'alias', or 'link', that 'points'
to the actual cgi-bin dir.  From what you mention above, it would appear to
be a case of specifying an improper URI.  It seems that the SSI statements
use 'relative' addressing.

   On the other hand; my reference books do not include a complete URL in
SSI statements. I mention this because, if you think about it: By specifying
a URL, you could be telling the server that it should be expecting a file
with HTML/Text Content (e.g. "Content-type: text/html \n\n";).

I hope this helps a little. I am very interested to find out if you recieve
a more correct answer.

Shawn




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

Date: Thu, 01 Apr 1999 20:30:04 -0500
From: david <optic@city-net.com>
Subject: simple HTTP_REFERER script?
Message-Id: <37041D9B.EA4683F9@city-net.com>

Hello

I need a simple script that will kick out a list of HTTP_REFERER
to a log, and then to an HTML page.  I want to keep track of
hits to my site through search engine queries.

I'm new to Perl.... but I would think that this should be a simple
enough operation.  

Any help?


Thanks, 

David


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

Date: Thu, 1 Apr 1999 14:02:12 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: two questions need help
Message-Id: <krf0e7.afb.ln@magna.metronet.com>

David L. Cassell (cassell@mail.cor.epa.gov) wrote:

: Why doesn't the -T flag
: check for the taint of immoral activities, so we wouldn't have
: to worry about this?  :-)


   I expect that feature is waiting for the (in?)famous 
   Net::ESP module to be released.

   I occasionally get "a feeling" that it might be on CPAN,
   but when I go check, it is never there  :-(


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 1 Apr 1999 14:17:10 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Why is this if stmt matching every file?
Message-Id: <mng0e7.afb.ln@magna.metronet.com>

tbrannon (brannon@quake.usc.edu) wrote:

: Subject: Why is this if stmt matching every file?


   Because the null pattern ( m// ) matches everything.


: #!/usr/bin/perl

   You have a bug on the very first line!

   See the BUGS section of the top level Perl man page (perl.pod),
   after that, have a look at perlrun.pod to figure out how to
   fix your bug.


: use File::Find;

: $dir{data}='/disks/newport/freeway/brannon/rs/ns-98/data/Golding_Spruston98';

: find(\&wanted,$dir{data});


   Above is where the function is called.

   Below is where you set the value that is supposed to be
   used in the function (and global variables are Very Bad anyway).

   See any problem there?


   The -w switch would have told you about your mistake immediately.


: $datafile_regexp='spiketimes.dat';


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

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

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