[22968] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5188 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 7 09:10:37 2003

Date: Mon, 7 Jul 2003 06:10:12 -0700 (PDT)
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, 7 Jul 2003     Volume: 10 Number: 5188

Today's topics:
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: thumbnail displaying main pic in new window <dropallx_webmasterx@xmbstevens.comx>
    Re: Using a variable within a tr// <bigj@kamelfreund.de>
    Re: Using a variable within a tr// <wsegrave@mindspring.com>
    Re: Using a variable within a tr// (Villy Kruse)
        Using semicolon delimited autosplit  "perl -aF\;" (C Marshall)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 07 Jul 2003 11:55:06 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <vginsqlgh3sudd@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 30 Jun 2003 11:59:49 GMT and ending at
07 Jul 2003 11:38:38 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2003 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org
comdog\@panix\.com

Totals
======

Posters:  236
Articles: 739 (329 with cutlined signatures)
Threads:  160
Volume generated: 1468.8 kb
    - headers:    660.9 kb (12,361 lines)
    - bodies:     762.5 kb (25,064 lines)
    - original:   476.8 kb (16,723 lines)
    - signatures: 44.7 kb (1,158 lines)

Original Content Rating: 0.625

Averages
========

Posts per poster: 3.1
    median: 2.0 posts
    mode:   1 post - 114 posters
    s:      5.1 posts
Posts per thread: 4.6
    median: 3.0 posts
    mode:   1 post - 31 threads
    s:      5.5 posts
Message size: 2035.3 bytes
    - header:     915.8 bytes (16.7 lines)
    - body:       1056.6 bytes (33.9 lines)
    - original:   660.7 bytes (22.6 lines)
    - signature:  61.9 bytes (1.6 lines)

Top 20 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   45   122.3 ( 50.4/ 66.0/ 54.0)  tadmc@augustmail.com
   27    54.5 ( 25.0/ 24.4/ 21.4)  abigail@abigail.nl
   27    66.6 ( 17.8/ 44.6/ 35.9)  Greg Bacon <gbacon@cs.uah.edu>
   23    57.3 ( 20.1/ 33.4/ 20.2)  mgjv@tradingpost.com.au
   17    36.7 ( 19.1/ 17.3/ 12.5)  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
   15    36.8 ( 18.7/ 16.6/  7.8)  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
   13    25.4 ( 12.8/  9.7/  4.4)  Uri Guttman <uri@stemsystems.com>
   12    20.8 ( 10.8/  9.1/  4.7)  Gunnar Hjalmarsson <noreply@gunnar.cc>
   10    18.5 (  7.9/ 10.5/  6.2)  "Sisyphus" <kalinabears@hdc.com.au>
   10    21.7 (  9.5/ 10.6/  7.0)  Michele Dondi <bik.mido@tiscalinet.it>
    9    14.9 (  7.8/  6.3/  2.4)  "bd" <bdonlan@bd-home-comp.no-ip.org>
    9    22.9 (  9.7/ 12.8/  9.7)  "Alan J. Flavell" <flavell@mail.cern.ch>
    9    16.8 (  8.2/  8.3/  2.4)  "John W. Krahn" <krahnj@acm.org>
    9    18.7 (  8.4/  9.5/  5.7)  Brian McCauley <nobull@mail.com>
    9    16.2 (  9.7/  6.4/  4.4)  woland99@earth*NO-SPAM*link.net
    9    17.2 (  7.1/ 10.1/  6.0)  Jay Tilton <tiltonj@erols.com>
    9    18.7 (  7.3/ 11.3/  3.6)  Max <maximuszen@optonline.net>
    9    17.9 (  6.8/ 11.1/  5.1)  Bryan Castillo <rook_5150@yahoo.com>
    8    18.9 (  7.8/  9.2/  5.4)  tassilo.parseval@post.rwth-aachen.de
    8    12.1 (  7.4/  4.6/  1.9)  Steve Grazzini <grazz@pobox.com>

These posters accounted for 38.8% of all articles.

Top 20 Posters by Number of Followups
=====================================

             (kb)   (kb)  (kb)  (kb)
Followups  Volume (  hdr/ body/ orig)  Address
---------  --------------------------  -------

       43   122.3 ( 50.4/ 66.0/ 54.0)  tadmc@augustmail.com
       27    54.5 ( 25.0/ 24.4/ 21.4)  abigail@abigail.nl
       26    66.6 ( 17.8/ 44.6/ 35.9)  Greg Bacon <gbacon@cs.uah.edu>
       23    57.3 ( 20.1/ 33.4/ 20.2)  mgjv@tradingpost.com.au
       15    36.7 ( 19.1/ 17.3/ 12.5)  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
       15    36.8 ( 18.7/ 16.6/  7.8)  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
       13    25.4 ( 12.8/  9.7/  4.4)  Uri Guttman <uri@stemsystems.com>
       12    20.8 ( 10.8/  9.1/  4.7)  Gunnar Hjalmarsson <noreply@gunnar.cc>
       10    18.5 (  7.9/ 10.5/  6.2)  "Sisyphus" <kalinabears@hdc.com.au>
        9    16.8 (  8.2/  8.3/  2.4)  "John W. Krahn" <krahnj@acm.org>
        9    21.7 (  9.5/ 10.6/  7.0)  Michele Dondi <bik.mido@tiscalinet.it>
        9    22.9 (  9.7/ 12.8/  9.7)  "Alan J. Flavell" <flavell@mail.cern.ch>
        9    17.2 (  7.1/ 10.1/  6.0)  Jay Tilton <tiltonj@erols.com>
        9    17.9 (  6.8/ 11.1/  5.1)  Bryan Castillo <rook_5150@yahoo.com>
        9    18.7 (  8.4/  9.5/  5.7)  Brian McCauley <nobull@mail.com>
        8    13.9 (  6.3/  7.2/  4.7)  Joe Smith <inwap@inwap.com>
        8    14.9 (  7.8/  6.3/  2.4)  "bd" <bdonlan@bd-home-comp.no-ip.org>
        8    18.9 (  7.8/  9.2/  5.4)  tassilo.parseval@post.rwth-aachen.de
        8    18.7 (  7.3/ 11.3/  3.6)  Max <maximuszen@optonline.net>
        8    12.1 (  7.4/  4.6/  1.9)  Steve Grazzini <grazz@pobox.com>

These posters accounted for 44.8% of all followups.

Top 10 Posters by Followup Rate (min. of ten posts)
===================================================

Followup
Rate      Followups  Posts  Address
--------  ---------  -----  -------

 100.00%         13     13  Uri Guttman <uri@stemsystems.com>
 100.00%         10     10  "Sisyphus" <kalinabears@hdc.com.au>
 100.00%         23     23  mgjv@tradingpost.com.au
 100.00%         27     27  abigail@abigail.nl
 100.00%         15     15  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
 100.00%         12     12  Gunnar Hjalmarsson <noreply@gunnar.cc>
  96.30%         26     27  Greg Bacon <gbacon@cs.uah.edu>
  95.56%         43     45  tadmc@augustmail.com
  90.00%          9     10  Michele Dondi <bik.mido@tiscalinet.it>
  88.24%         15     17  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>

Top 20 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 122.3 ( 50.4/ 66.0/ 54.0)     45  tadmc@augustmail.com
  66.6 ( 17.8/ 44.6/ 35.9)     27  Greg Bacon <gbacon@cs.uah.edu>
  57.3 ( 20.1/ 33.4/ 20.2)     23  mgjv@tradingpost.com.au
  54.5 ( 25.0/ 24.4/ 21.4)     27  abigail@abigail.nl
  36.8 ( 18.7/ 16.6/  7.8)     15  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
  36.7 ( 19.1/ 17.3/ 12.5)     17  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
  25.4 ( 12.8/  9.7/  4.4)     13  Uri Guttman <uri@stemsystems.com>
  22.9 (  9.7/ 12.8/  9.7)      9  "Alan J. Flavell" <flavell@mail.cern.ch>
  21.7 (  9.5/ 10.6/  7.0)     10  Michele Dondi <bik.mido@tiscalinet.it>
  20.8 ( 10.8/  9.1/  4.7)     12  Gunnar Hjalmarsson <noreply@gunnar.cc>
  18.9 (  7.8/  9.2/  5.4)      8  tassilo.parseval@post.rwth-aachen.de
  18.7 (  8.4/  9.5/  5.7)      9  Brian McCauley <nobull@mail.com>
  18.7 (  7.3/ 11.3/  3.6)      9  Max <maximuszen@optonline.net>
  18.5 (  7.9/ 10.5/  6.2)     10  "Sisyphus" <kalinabears@hdc.com.au>
  17.9 (  6.8/ 11.1/  5.1)      9  Bryan Castillo <rook_5150@yahoo.com>
  17.2 (  7.1/ 10.1/  6.0)      9  Jay Tilton <tiltonj@erols.com>
  16.8 (  8.2/  8.3/  2.4)      9  "John W. Krahn" <krahnj@acm.org>
  16.2 (  9.7/  6.4/  4.4)      9  woland99@earth*NO-SPAM*link.net
  15.7 (  5.6/  8.8/  5.1)      7  Benjamin Goldberg <ben.goldberg@hotpop.com>
  15.0 (  4.9/ 10.1/  2.9)      7  Math55 <magelord@t-online.de>

These posters accounted for 43.5% of the total volume.

Top 10 Posters by Volume of Original Content (min. ten posts)
=============================================================

        (kb)
Posts   orig  Address
-----  -----  -------

   45   54.0  tadmc@augustmail.com
   27   35.9  Greg Bacon <gbacon@cs.uah.edu>
   27   21.4  abigail@abigail.nl
   23   20.2  mgjv@tradingpost.com.au
   17   12.5  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
   15    7.8  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
   10    7.0  Michele Dondi <bik.mido@tiscalinet.it>
   10    6.2  "Sisyphus" <kalinabears@hdc.com.au>
   12    4.7  Gunnar Hjalmarsson <noreply@gunnar.cc>
   13    4.4  Uri Guttman <uri@stemsystems.com>

These posters accounted for 36.6% of the original volume.

Top 10 Posters by OCR (minimum of ten posts)
============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.881  ( 21.4 / 24.4)     27  abigail@abigail.nl
0.819  ( 54.0 / 66.0)     45  tadmc@augustmail.com
0.806  ( 35.9 / 44.6)     27  Greg Bacon <gbacon@cs.uah.edu>
0.723  ( 12.5 / 17.3)     17  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
0.662  (  7.0 / 10.6)     10  Michele Dondi <bik.mido@tiscalinet.it>
0.604  ( 20.2 / 33.4)     23  mgjv@tradingpost.com.au
0.594  (  6.2 / 10.5)     10  "Sisyphus" <kalinabears@hdc.com.au>
0.519  (  4.7 /  9.1)     12  Gunnar Hjalmarsson <noreply@gunnar.cc>
0.469  (  7.8 / 16.6)     15  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
0.459  (  4.4 /  9.7)     13  Uri Guttman <uri@stemsystems.com>

Bottom 10 Posters by OCR (minimum of ten posts)
===============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.881  ( 21.4 / 24.4)     27  abigail@abigail.nl
0.819  ( 54.0 / 66.0)     45  tadmc@augustmail.com
0.806  ( 35.9 / 44.6)     27  Greg Bacon <gbacon@cs.uah.edu>
0.723  ( 12.5 / 17.3)     17  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
0.662  (  7.0 / 10.6)     10  Michele Dondi <bik.mido@tiscalinet.it>
0.604  ( 20.2 / 33.4)     23  mgjv@tradingpost.com.au
0.594  (  6.2 / 10.5)     10  "Sisyphus" <kalinabears@hdc.com.au>
0.519  (  4.7 /  9.1)     12  Gunnar Hjalmarsson <noreply@gunnar.cc>
0.469  (  7.8 / 16.6)     15  "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
0.459  (  4.4 /  9.7)     13  Uri Guttman <uri@stemsystems.com>

10 posters (4%) had at least ten posts.

Top 20 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   24  doing 'ref' on blessed reference
   22  Alternative to use vars
   18  Automatic page forwarding in cgi perl script
   17  A little regex help?
   17  Is there a good free/not so expensive Perl IDE for Linux
   16  need a cheap JOIN on 3 large tables under Win32
   15  How would you mail yourself from XP
   14  naming hash using a variable name.
   13  Using undef as an array subscript
   12  How can I analyse jpg file with perl?
   11  Net::POP3
   11  Using a variable within a tr//
   11  k operator in REGEX??
   10  renaming badly named files...
   10  script for unrestricted permutation
   10  Q: detect non-existent hash entries w/function?
   10  Confused with array and references
    9  letters in a scalar to array
    9  Problem with tk and displaying on the screen
    9  Need help with Win32::GuiTest and Indigo perl

These threads accounted for 36.3% of all articles.

Top 20 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  53.0 ( 22.2/ 28.3/ 17.7)     22  Alternative to use vars
  45.5 ( 22.0/ 18.2/  9.7)     24  doing 'ref' on blessed reference
  37.0 ( 17.5/ 19.0/  8.0)     18  Automatic page forwarding in cgi perl script
  33.8 (  1.9/ 32.0/ 32.0)      2  Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
  32.7 ( 14.7/ 15.6/ 10.2)     17  A little regex help?
  30.9 ( 15.3/ 14.7/  8.8)     16  need a cheap JOIN on 3 large tables under Win32
  27.3 ( 13.4/ 13.4/  8.2)     15  How would you mail yourself from XP
  26.1 ( 17.0/  7.8/  4.3)     17  Is there a good free/not so expensive Perl IDE for Linux
  25.4 ( 13.2/ 10.4/  5.8)     14  naming hash using a variable name.
  24.8 (  9.8/ 13.9/  9.8)     10  Confused with array and references
  23.7 (  7.5/ 15.6/  6.7)      9  Getting the size of files from a list?
  22.5 ( 10.4/ 11.1/  6.5)     13  Using undef as an array subscript
  22.0 (  8.8/ 13.1/  7.6)     10  script for unrestricted permutation
  20.7 ( 11.1/  9.5/  6.1)     12  How can I analyse jpg file with perl?
  20.4 (  7.4/ 12.5/  5.0)      8  SHIFT not shuffling ?
  20.0 ( 11.1/  8.4/  4.1)     11  Net::POP3
  19.8 ( 10.3/  9.3/  5.5)     11  Using a variable within a tr//
  19.5 (  6.9/ 12.1/  6.2)      8  using 'DB_File' versus just plain tie() ?
  19.4 (  9.0/  9.7/  4.2)     10  renaming badly named files...
  19.0 (  7.1/ 11.9/  8.5)      7  need assistance understanding multilevel hashes.

These threads accounted for 37.0% of the total volume.

Top 17 Threads by OCR (minimum of ten posts)
============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.771  (  4.5/   5.9)     11  k operator in REGEX??
0.705  (  9.8/  13.9)     10  Confused with array and references
0.651  ( 10.2/  15.6)     17  A little regex help?
0.641  (  6.1/   9.5)     12  How can I analyse jpg file with perl?
0.625  ( 17.7/  28.3)     22  Alternative to use vars
0.615  (  8.2/  13.4)     15  How would you mail yourself from XP
0.601  (  5.3/   8.9)     10  Q: detect non-existent hash entries w/function?
0.600  (  8.8/  14.7)     16  need a cheap JOIN on 3 large tables under Win32
0.595  (  5.5/   9.3)     11  Using a variable within a tr//
0.590  (  6.5/  11.1)     13  Using undef as an array subscript
0.584  (  7.6/  13.1)     10  script for unrestricted permutation
0.555  (  5.8/  10.4)     14  naming hash using a variable name.
0.548  (  4.3/   7.8)     17  Is there a good free/not so expensive Perl IDE for Linux
0.531  (  9.7/  18.2)     24  doing 'ref' on blessed reference
0.493  (  4.1/   8.4)     11  Net::POP3
0.435  (  4.2/   9.7)     10  renaming badly named files...
0.424  (  8.0/  19.0)     18  Automatic page forwarding in cgi perl script

Bottom 17 Threads by OCR (minimum of ten posts)
===============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.771  (  4.5 /  5.9)     11  k operator in REGEX??
0.705  (  9.8 / 13.9)     10  Confused with array and references
0.651  ( 10.2 / 15.6)     17  A little regex help?
0.641  (  6.1 /  9.5)     12  How can I analyse jpg file with perl?
0.625  ( 17.7 / 28.3)     22  Alternative to use vars
0.615  (  8.2 / 13.4)     15  How would you mail yourself from XP
0.601  (  5.3 /  8.9)     10  Q: detect non-existent hash entries w/function?
0.600  (  8.8 / 14.7)     16  need a cheap JOIN on 3 large tables under Win32
0.595  (  5.5 /  9.3)     11  Using a variable within a tr//
0.590  (  6.5 / 11.1)     13  Using undef as an array subscript
0.584  (  7.6 / 13.1)     10  script for unrestricted permutation
0.555  (  5.8 / 10.4)     14  naming hash using a variable name.
0.548  (  4.3 /  7.8)     17  Is there a good free/not so expensive Perl IDE for Linux
0.531  (  9.7 / 18.2)     24  doing 'ref' on blessed reference
0.493  (  4.1 /  8.4)     11  Net::POP3
0.435  (  4.2 /  9.7)     10  renaming badly named files...
0.424  (  8.0 / 19.0)     18  Automatic page forwarding in cgi perl script

17 threads (10%) had at least ten posts.

Top 11 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      22  comp.lang.perl.modules
      15  alt.perl
      12  comp.lang.perl
       8  comp.lang.tcl
       6  comp.lang.python
       5  comp.databases.ibm-db2
       3  comp.mail.sendmail
       2  comp.lang.perl.tk
       2  alt.folklore.computers
       1  microsoft.public.dotnet.csharp.general
       1  comp.unix.tru64

Top 20 Crossposters
===================

Articles  Address
--------  -------

      13  "Lev Altshuler" <levalt@rogers.com>
       5  Mina Naguib <spam@thecouch.homeip.net>
       4  Charlton Wilbur <cwilbur@mithril.chromatico.net>
       4  ctcgag@hotmail.com
       3  "Reto Hersiczky" <retoh@cut-here-infocopter.ch>
       3  tassilo.parseval@post.rwth-aachen.de
       3  Steve Grazzini <grazz@pobox.com>
       3  Jay Tilton <tiltonj@erols.com>
       3  Beable van Polasm <beable+unsenet@beable.com.invalid>
       3  Benjamin Goldberg <ben.goldberg@hotpop.com>
       2  Wojciech Kocjan <wojciech@n0spam-kocjan.org>
       2  Kenjis Kaan <tivolinewbie@canada.com>
       2  claird@phaseit.net
       2  Peter Pentchev <roam@ringlet.net>
       2  Gunnar Hjalmarsson <noreply@gunnar.cc>
       2  "Ian D. Bjorhovde" <ianbjor@mobileaudio.com>
       2  Al Kossow <aek@spies.com>
       2  Paul Boddie <paul@boddie.net>
       2  Kyler Laird <Kyler@news.Lairds.org>
       2  Stephen Patterson <s.patterson@freeuk.com>


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

Date: Mon, 07 Jul 2003 04:22:31 GMT
From: m <dropallx_webmasterx@xmbstevens.comx>
Subject: Re: thumbnail displaying main pic in new window
Message-Id: <tu2igv07nvu7tkltiq9v2dbbcmkq4oar6g@4ax.com>

On or around Sat, 5 Jul 2003 09:02:38 +0200, there was a message,
possibly from "D.Selby" <david.selby@wanadoo.fr>, as follows:

>Hi
>
>I'm not sure if this is the best place to post this query .. but if anybody
>has any better suggestions, please let me know.
>
>I wonder if somebody could help me.  I am using a .cgi perl script to
>display data retrieved from a database.  Within the .cgi script I am also
>displaying photos which are stored directly on the server.  When a user
>clicks on the thumbnail, I want to be able to display the big picture in a
>new window, but I want to specify the size of the window and display it
>without toolbar or menubar.

Ugh!  You could have Perl generate a javascript popup
in a here document.  Here's how a JS popup looks:

<a href="images/11.jpg"  
onclick="window.open('images/11.jpg','flowerwin','width=500,
height=406'); return false;">
<img src="images/1.jpg" width="50" height="41" alt="flower" />
<br />(Image opens in a new window.)</a>

 ...but the Perl program would substitute variables for the filename,
width, height, and alt properties.
(This becomes considerably complicated if you're trying
to generate valid XHTML, by the way, because of the CDATA
requirement).

You'd do better displaying the thumbnails in a normal window
because of accessibility problems with JS popups... blind users,
lynx users, users on PDAs, etc. won't be able to follow to the popup
window easily.

My take on the whole problem is at:
http://www.mbstevens.com/howtothumb/
 ... hope it's helpful.

m





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

Date: Mon, 07 Jul 2003 02:51:21 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: Using a variable within a tr//
Message-Id: <pan.2003.07.07.00.51.14.884009@kamelfreund.de>

David Filmer wrote at Sun, 06 Jul 2003 22:33:16 +0000:

> I can't seem to do:
> 
>    $vowels = 'aeiou'; $VOWELS = 'AEIOU';
>    tr/$vowels/$VOWELS/;   #make all vowels uppercase
> 
> Perl doesn't see '$vowels' as a variablename, but as a 7-byte string
> literal.

That's the way tr works.

> Of course, it works fine if I say
> 
>    tr/aeiou/AEIOU/;

Or even

eval "tr/$vowels/$VOWELS/;

or

s/([$vowels])/\u$1/g;

> but I would like to know the proper syntax to do it with variablenames.....

There's no such one,
but you can either do a run time evaluation like above or
just a global substitution what I would prefer.


Greetings,
Janek


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

Date: Mon, 7 Jul 2003 01:13:12 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: Using a variable within a tr//
Message-Id: <beb3bn$k8h$1@slb9.atl.mindspring.net>

"David Filmer" <ineverreadanythinsenttome@hotmail.com> wrote in message
news:Ms1Oa.21787$I8.13027@rwcrnsc53...
> I can't seem to do:
>
>    $vowels = 'aeiou'; $VOWELS = 'AEIOU';
>    tr/$vowels/$VOWELS/;   #make all vowels uppercase
>
> Perl doesn't see '$vowels' as a variablename, but as a 7-byte string
> literal.
>
> Of course, it works fine if I say
>
>    tr/aeiou/AEIOU/;
>
> but I would like to know the proper syntax to do it with
variablenames.....
>
> TIA

See pp. 74-76, PP2e (Camel Book).

eval "tr/$vowels/$VOWELS/, 1" or die $@;   # make all vowels uppercase

works fine here, as suggested in PP2e.

Cheers.

Bill Segraves

P.S. Hint: tr/// is an *op*erator. Look for documentation in perlop. Even if
you called it it a function instead and looked in perlfunc, you'd be
referred to perlop for details. Look in perlop at the end of "Regexp
Quote-Like Operators", just before "Gory Details ...".




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

Date: 07 Jul 2003 07:49:49 GMT
From: vek@station02.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Using a variable within a tr//
Message-Id: <slrnbgi9gs.317.vek@station02.ohout.pharmapartners.nl>

On Mon, 07 Jul 2003 03:30:57 GMT,
    David Filmer <ineverreadanythinsenttome@hotmail.com> wrote:


>I did not know that there was even such a section as perlop.  Most
>'operations' are pretty self-evident and don't require documentation to use,
>at least for basic tasks. I've never before needed docs for an operation.
>


Next trick:  "perldoc perl" will tell you.  IMHO it is a good ide to 
(scim)read all of those pages to give an idea of where things are to be
found.  Perhaps you could skip reading the following:

   perlembed           Perl ways to embed perl in your C or C++ application
   perlapio            Perl internal IO abstraction interface
   perlxs              Perl XS application programming interface
   perlxstut           Perl XS tutorial
   perlguts            Perl internal functions for those doing extensions
   perlcall            Perl calling conventions from C



Villy


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

Date: 7 Jul 2003 03:26:04 -0700
From: c_j_marshall@hotmail.com (C Marshall)
Subject: Using semicolon delimited autosplit  "perl -aF\;"
Message-Id: <cb9c7b76.0307070226.3bdbe9d4@posting.google.com>

I haven't had any luck managing to autosplit on the semi colon
character under AIX when putting my commandline options into a script.

i.e. whilst

echo "1;2;3"| perl -anl -F\; -e 'print "$F[1]"'
2

works correctly I cannot reproduce the effects in a script 

eg
echo "1;2;3"| test.pl                          
Use of uninitialized value in string at test.pl line 4, <> line 1 (#1)
    
    (W uninitialized) An undefined value was used as if it were
already defined.  It was
    interpreted as a "" or a 0, but maybe it was a mistake.  To
suppress this
    warning assign a defined value to your variables.

where test.pl is:
#!/usr/bin/perl -awnl -F\;
use diagnostics;

print "$F[1]";


I've tried a variety of formats for the -F line e.g
"\;"
""\;""
"'\;'"
";"
\073
\x3A
/\073/
/\;/

etc. to no avail.

Any idea where I'm going wrong ?

perl, v5.6.0 built for aix

Thanks 
Chris


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

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.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.

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 V10 Issue 5188
***************************************


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