[7240] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 865 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 14 10:07:12 1997

Date: Thu, 14 Aug 97 07:00:49 -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           Thu, 14 Aug 1997     Volume: 8 Number: 865

Today's topics:
     Re: %ENV on PerlIS ? <khown@imap1.asu.edu>
     Re: %ENV on PerlIS ? <khown@imap1.asu.edu>
     Re: A Perl compiler for Win95? (Danny Aldham)
     Re: Capitals <rael@zx81.dnai.com>
     CGI: Forms RADIO BUTTONS <lmisosa@eei.ericsson.se>
     Re: converting from hex (Scott Houck)
     Re: emacs?  No thank you lvirden@cas.org
     Re: jumping to a URL (Kyzer)
     Re: Looking for a routine to trim white space  (like VB (Craig Berry)
     Re: Name of NT Port that also runs in Win32s (win 3.1)? <merlyn@stonehenge.com>
     need clarification on Package::method() and Package->me (Curtis Hrischuk)
     need help with perl and dates <ehsmakh@aom.ericsson.se>
     Re: need help with perl and dates <tom@mitra.phys.uit.no>
     Re: need help with perl and dates (Tad McClellan)
     Re: need help with perl and dates <tw36027@glaxowellcome.com>
     Re: Newbie ?? Can PERL scan for substrings from serial  <merlyn@stonehenge.com>
     Re: Parser for CSS? (Tina Marie Holmboe)
     Perl 5 permanently loaded <pegit.swedmap@mbox300.swipnet.se>
     Re: Perl and Windows NT <mturk@westonia.com>
     Re: perl process problem (Mike D. Kail)
     Perl.exe vs PerlIS.dll on NT S 4.0 <pegit.swedmap@mbox300.swipnet.se>
     Setting Groupid <kchin@nva.lmco.com>
     Socket error using IIS and perl with NT <spg@corporatenet.net.au>
     Re: Someone Want a Challenge? (Nathan V. Patwardhan)
     Re: sorting... <jefpin@bergen.org>
     Re: Trouble building SCO dynamic loading ... (Danny Aldham)
     Re: version of Perl5 for NT4 (Danny Aldham)
     Year 2000 compliant? <arwen.mullikin@transquest.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 13 Aug 1997 20:55:41 -0700
From: Otis Nettles <khown@imap1.asu.edu>
To: pinne@pegit-se
Subject: Re: %ENV on PerlIS ?
Message-Id: <33F281BD.7827EF94@imap1.asu.edu>

MS thought they would save memory by creating the array until after its
been used.  To access the variables, first use them, and then you'll be
able to see them.

Ex:

$ENV{'REMOTE_USER'};
print $ENV{'REMOTE_USER'};

Pinne wrote:
> 
> Hi,
> 
> Anyone else who runs PerlIS on NT S.
> I run PerlIS (5.003 build 306) from Aciveware on
> NT S 4.0 w IIS 3.0.
> It seems like there are no usable entries in the
> ENV-array.
> It's just one, containing some version stuff.
> I had difficulties installing Perl.exe for IIS 3.0,
> couldn't make it work. PerlIS worked though, so I
> thought since that one's a ddl I should be able to
> get away with less overhead and used it instead.
> But I don't know if I can use it without the ENV-
> information.
> Any help, suggestions etc are very welcome.
> Thanks in advance.
> /regards

-- 
Otis Nettles
Interactive Applications
otis77@hotmail.com
(602) 786 - 3224


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

Date: Wed, 13 Aug 1997 20:56:01 -0700
From: Otis Nettles <khown@imap1.asu.edu>
Subject: Re: %ENV on PerlIS ?
Message-Id: <33F281D1.C129A0CF@imap1.asu.edu>

MS thought they would save memory by creating the array until after its
been used.  To access the variables, first use them, and then you'll be
able to see them.

Ex:

$ENV{'REMOTE_USER'};
print $ENV{'REMOTE_USER'};

Pinne wrote:
> 
> Hi,
> 
> Anyone else who runs PerlIS on NT S.
> I run PerlIS (5.003 build 306) from Aciveware on
> NT S 4.0 w IIS 3.0.
> It seems like there are no usable entries in the
> ENV-array.
> It's just one, containing some version stuff.
> I had difficulties installing Perl.exe for IIS 3.0,
> couldn't make it work. PerlIS worked though, so I
> thought since that one's a ddl I should be able to
> get away with less overhead and used it instead.
> But I don't know if I can use it without the ENV-
> information.
> Any help, suggestions etc are very welcome.
> Thanks in advance.
> /regards

-- 
Otis Nettles
Interactive Applications
otis77@hotmail.com
(602) 786 - 3224


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

Date: 13 Aug 1997 22:24:46 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: A Perl compiler for Win95?
Message-Id: <5su4qu$2i2$1@lennon.postino.com>

Thomas Larsson (thomas.larsson@vpress.se) wrote:
: Can anyone supply me with an adress to a site where I can download a
: Perl compilator?

Perl is not a compiled language, but there IS a compiler 
available at any CPAN site. It is still sort of beta on 
unix, so I would be leary of trying it on windows. 
But if you are looking for a perl binary, check at 
www.activeware.com , download  Pw32i307.exe and run it.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 14 Aug 1997 00:28:46 -0700
From: Rael Dornfest <rael@zx81.dnai.com>
Subject: Re: Capitals
Message-Id: <873eod440h.fsf@zx81.dnai.com>


John Grimm <jgrimm@wireedm.com> writes:

> How can I convert a string to all capitals?

Take a look at the perlre manpage...

[snip]

           \l          lowercase next char (think vi)
           \u          uppercase next char (think vi)
           \L          lowercase till \E (think vi)
           \U          uppercase till \E (think vi)
           \E          end case modification (think vi)

[snip]

For example:

"\lFOO"      -> fOO
"\ufoo"      -> Foo
"\LFOO"      -> foo
"\Ufoo"      -> FOO
"\Ufoo\Ebar" -> FOObar

So, what you probably want is something like:

$somestring = "\U${somestring}";

Rael

--------------------------------------------------------------------------
Rael Dornfest      Direct Network Access        Email.       rael@dnai.com   
                   2039 Shattuck Avenue                  webmaven@dnai.com   
Vice President     Suite 206                    Web.   http://www.dnai.com
Webmaven           Berkeley, California 94704   Voice.        888.321.DNAI


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

Date: Thu, 14 Aug 1997 11:32:26 +0100
From: Shaun O'Shea <lmisosa@eei.ericsson.se>
Subject: CGI: Forms RADIO BUTTONS
Message-Id: <33F2DEBA.79CC@eei.ericsson.se>

Hi,
  I hve just started trying to use forms and I'm having a bit of
trouble:

I have some radio buttons and a text form on one page and I'm having
trouble trying to get the state of the radio buttons in the resulting
perl script.


The following is the relevant exerpt from the first page:

<form action="/cgi-bin/s1.pl"
      method="POST"><br>

<P><input type="radio" name="tpe" value="eng" checked>  ##Choice 1</P>

<P><input type="radio" name="tpe" value="dec"> ##choice 2</P>

<P><B><I><FONT COLOR="#0000FF"><FONT SIZE=+2>Enter your search string
below:</FONT><FONT SIZE=+3>
</FONT></FONT></I></B></P>

<textarea name="string" cols=40 rows=4>
</textarea>

<input type="reset" value="Reset">
<input type="submit" value="search">
</form>


##Now I know that if I want to get what's in the text search string I
do:


%incoming = &read_input;        # Read information into associated
                                # array %incoming.
$your_text = $incoming{'string'}; # Fetch the text from the array.
print $your_text;               # Print the text.  


I'm using the subroutine &read_input:
sub read_input
{
    local ($buffer, @pairs, $pair, $name, $value, %FORM);
    # Read in text
    $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
    if ($ENV{'REQUEST_METHOD'} eq "POST")
    {
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    } else
    {
        $buffer = $ENV{'QUERY_STRING'};
    }
    # Split information into name/value pairs
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs)
    {
        ($name, $value) = split(/=/, $pair);
        $value =~ tr/+/ /;
        $value =~ s/%(..)/pack("C", hex($1))/eg;
        $FORM{$name} = $value;
    }
    %FORM;
}

But I want to know how to read the state of the radio buttons.
Any help or good CGI URL's much appreciated.

			Shaun.............:-) 
-- 
***********************************************************************
Shaun O'Shea,
lmisosa@eei.ericsson.se
OR
shaunos@orca.ucd.ie
***********************************************************************


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

Date: Thu, 14 Aug 1997 05:36:27 GMT
From: scott@radix.net (Scott Houck)
Subject: Re: converting from hex
Message-Id: <33f295c3.54957705@news1.radix.net>

Prince Mystery <mystery@itis.com> wrote:

>I'm trying to take a hex rgb value (ala #ffffff) and convert it to a
>three member array of decimal equivalents for each of those values, r,
>g, and b.
>
>for example:
>
>string '#ffffff' would then produce (255,255,255);

Assuming you always have a 7-character string, this would work:

$hexstring = "#ffffff";
@rgb = map {hex} $hexstring =~ /#(..)(..)(..)/;
print "($rgb[0], $rgb[1], $rgb[2])\n";


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

Date: 14 Aug 1997 11:44:19 GMT
From: lvirden@cas.org
Subject: Re: emacs?  No thank you
Message-Id: <5sur2j$jsk$1@cas.org>


According to Gabor <fubar@vinyl.quickweb.com>:
:Kenneth Vogt (KenVogt@rkymtnhi.com) wrote:
:
:: Thanks to everyone that suggested emacs for Windows.  However, it is one
:: of the UGLIEST things I have ever seen!  (I'm not trying to start an
:
:There are things in life that should be pretty.  An editor is not one
:of them.  I expect an editor to be functional, don't you?

There are things in life that are functional, but an abomination to attempt
to use by the novice .  In _some folks eyes_ emacs is one of these things.


The point is, there are folk who would prefer a graphical interactive
debugging development environment.  If they are willing to pay, they should
contact folk doing contract work or vendors to see if someone was available
to create such a thing, or begin working on something their selves.

Since it seems from reading USENET that the Perl/Tk combination is currently
the most common X Graphical Environment, I would think that would be a place
to start for someone using X.  For someone who doesn't use X, Perl Tk
_might_ still be an option as the basis for writing an IDE, as there is
hope that Perl Tk will eventually support the 3 major windowing platforms.

There was, at one time, the beginnings of a graphical debugger in Perl Tk.
I don't know whether anything's been done with that or not.  Read over
<URL: http://w4.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html > for the details.
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: 14 Aug 1997 04:05:55 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: jumping to a URL
Message-Id: <5su073$pgi$1@info.abdn.ac.uk>

Hurrah, for 'tis said that Patrick Wiseman did write:
: Sam Mingolelli wrote:
: > When the program gets into a specific subroutine I would like to
: > instruct the browser to jump to a designated URL.
: print "Location:$URL\n\n";
: where $URL is the FULL URL to which you wish to jump.

I would suggest a space in there - print "Location: $URL\n\n";
Even better, I would suggest making use of one of the CGI modules available
at http://www.perl.com/CPAN/

Then you can do, as part of the powerful command set available, this:
print $my_form->redirect($URL);

--
Stuart 'Kyzer' Caie, Aberdeen University, Scotland.  Email to: kyzer@4u.net
My opinions are not those of Aberdeen University, and I do not speak for or
on behalf of AUCC.
                   ..100% Amiga, forever!..  http://www.abdn.ac.uk/~u13sac/

-- 
Random sig of the day:
"Slightly less safe than joining the mile high club bareback with a junkie
whore in a plane flying over a war zone with three engines on fire, a pissed
up pilot and Carlos the Jackal sitting RIGHT BEHIND YOU" - MK3 advert.


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

Date: 14 Aug 1997 04:58:07 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Looking for a routine to trim white space  (like VB trim$)
Message-Id: <5su38v$d4q$1@marina.cinenet.net>

Peter J. Schoenster (pschon@baste.magibox.net) wrote:
: >Steve O'Hara Smith (sohara@mardil.elsevier.nl) wrote:
: >Why not just use
: >
: >  ($stripped) = $unstripped =~ /^\s*(.*?)\s*$/;
: 
: >cberry@cinenet.net (Craig Berry) wrote:
: >Though even this is woefully inefficient, involving lots of backtracking 
: >internally on many strings.  Better still might be doing it in two 
: >passes, one for each end of the string:
: >
: >  $stripped = $unstripped;
: >  $stripped =~ s/^\s+//;
: >  $stripped =~ s/\s+$//;
: >
: >Hope this helps!
: 
: How would I begin to understand why the first method was inefficient.
: 
: It would seem that the second method would be more inefficient
: (although, oddly, that is the way I tend to do things but I think that
: is because I don't have a firm graps of the proper use of
: parentheseis).

It's not the use of parentheses that hurts here, really; it's the use of 
multiple multi-matchers (* and +).  If you use these poorly, especially * 
(which can match 'nothingness'), and with many such in one pattern, you 
can end up forcing the search engine to move back and forth many times 
over the string being matched, trying every combination of partitioning 
characters between the multi-matchers.

For more on this topic than you'd imagine possible, and many other 
'perls' of wisdom, see Jeff Freidl's brilliant _Mastering Regular 
Expressions_.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 14 Aug 1997 06:38:04 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: smedit@access5.digex.net (Richard Puckett)
Subject: Re: Name of NT Port that also runs in Win32s (win 3.1)?
Message-Id: <8crabwubpf.fsf@gadget.cscaper.com>

>>>>> "Richard" == Richard Puckett <smedit@access5.digex.net> writes:

Richard> Does anyone know the name of a putative PERL 4.X port for
Richard> Windows NT that is also supported in the Win32s environment?
Richard> Supposedly it runs in Windows 3.1 with the standard Windows
Richard> GUI.  I was assured that such a port is available, but I have
Richard> not been able to find it.

Perl 4 is dead, dead, dead (and is a CERT-ifiably bad security leaker
to boot).  The Perl 5 port (upward compatible) is in the CPAN near
http://www.perl.com/CPAN/ports/.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 383 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 14 Aug 1997 12:18:03 GMT
From: ceh@suntan.sce.carleton.ca (Curtis Hrischuk)
Subject: need clarification on Package::method() and Package->method()
Message-Id: <CEH.97Aug14081803@suntan.sce.carleton.ca>

Hi. 

I am using a package as a database of filetypes, with a hash table
mapping logical names to actual values.  To access the values in the
hash table I use the autoloader to search the database using the hash
key value (i.e., standard Perl trick).  I have found that
Package::method() and Package->method() behave differently in this
situation.

For example:

package Package;
my %Common_fields = ( FTYPE_TRACE 	=> '.text');
my $self = \%Common_fields;                  # so that autoloader will return ftype_trace()='.text'

package Other;
$aVar1 = Package::ftype_trace();
$aVar2 = Package->ftype_trace();

$aVar3 = 'myfile' . $aVar1;
print $aVar3;                                # prints 'myfile.text';

$aVar4 = 'myfile' . $aVar2;
print $aVar4;                                # prints 'Package.text';



Curtis
-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Curtis Hrischuk (PhD Cand)  "in reality that comes from above      _/
_/ ceh @ sce . carleton . ca    God is calling                        _/
_/ Carleton University          there's no bigger love                _/
_/ Ottawa, On., Canada, K1S-5B6 It's his reality that welcomes us back_/
_/ Ph  (613) 520-2600 x1762     Trust and obey                        _/
_/ FAX (613) 520-5727           there is no other way..." the newsboys_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


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

Date: Thu, 14 Aug 1997 08:56:53 +0200
From: Masoud M-Kho'i EHS/LI 80441 3322 <ehsmakh@aom.ericsson.se>
Subject: need help with perl and dates
Message-Id: <33F2AC33.D53B89EC@aom.ericsson.se>

Hi,

I'm a beginner with perl and now I'm constructing webpages with perl.
Poweful language but I have run into problems which I can't find a
solution to. I want to fetch the date from the computer time and assign
it to a variable. I'm just interested in the date. I found out one way
to do it:

$date=`date '+%y%m%d'`;

It works fine except that a newline is inserted in the end and it's
essential for me not to have the newline there.
What to do instead? Why is there a newline? Why can't I see the newline
as a symbol or something?
I saw the Perl motto saying "There's more than one way to do it" and
maybe there is another way...


I'm in desperate need of help to solve my problem. Help!!


Regards,
Masoud M. Kho'i
Ericsson Hewlett Packard Telecommunications
Sweden

\



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

Date: 14 Aug 1997 09:45:01 +0000
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: need help with perl and dates
Message-Id: <nqo67t96qua.fsf@mitra.phys.uit.no>

Masoud M-Kho'i EHS/LI 80441 3322 <ehsmakh@aom.ericsson.se> writes:

> Hi,

Hello, there.

> I'm just interested in the date. I found out one way to do it:

> $date=`date '+%y%m%d'`;
> 
> It works fine except that a newline is inserted in the end and it's
> essential for me not to have the newline there.

If you really want to use date, try

chomp($date=`date '+%y%m%d'`);

or you can look for localtime in your friendly documentation.

> I'm in desperate need of help to solve my problem. Help!!

HTH,

> Masoud M. Kho'i

> Sweden

Aha, det forklarer saken!

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Thu, 14 Aug 1997 05:33:00 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: need help with perl and dates
Message-Id: <ssmus5.eo.ln@localhost>

Masoud M-Kho'i EHS/LI 80441 3322 (ehsmakh@aom.ericsson.se) wrote:
: Hi,

: I'm a beginner with perl and now I'm constructing webpages with perl.
        ^^^^^^^^^^^^^^^^^^

Then let me offer what is likely the most helpful advice you will
ever get regarding how to resolve Perl programming problems  ;-)

1) There are hundreds of pages of free documentation that are included
   with the perl distribution. They end with a '.pod' filename
   extension.

   Find out where these are on your system, and do a few well
   selected word searches in them whenever you run into a perl problem.


: Poweful language but I have run into problems which I can't find a
                                                        ^^^^^^^^^^
: solution to. 


This must be because you did not look...


: I want to fetch the date from the computer time and assign
: it to a variable. I'm just interested in the date. I found out one way
: to do it:

: $date=`date '+%y%m%d'`;


That is Operating System dependant you know.

It may break when if you move the script to a different OS.

No need to make your script so fragile (see localtime in perlfunc.pod).


: It works fine except that a newline is inserted in the end and it's
: essential for me not to have the newline there.
                                   ^^^^^^^
: What to do instead? 

A word search for 'newline' in the above mentioned docs finds only
55 lines to check. 

I found the answer in less that 30 seconds. 

Much faster that posting to Usenet. That is working smart...


   chomp($date=`date '+%y%m%d'`);


: Why is there a newline? 


Because the shell puts it there, as it does with nearly every command.


from the perlop.pod man page (my underlining):

----------------------
=head2 I/O Operators

There are several I/O operators you should know about.
A string is enclosed by backticks (grave accents) first undergoes
variable substitution just like a double quoted string.  It is then
interpreted as a command, and the output of that command is the value
of the pseudo-literal, like in a shell.  In a scalar context, a single
string consisting of all the output is returned.  In a list context,
a list of values is returned, one for each line of output.  (You can
set C<$/> to use a different line terminator.)  The command is executed
each time the pseudo-literal is evaluated.  The status value of the
command is returned in C<$?> (see L<perlvar> for the interpretation
of C<$?>).  Unlike in B<csh>, no translation is done on the return
data--newlines remain newlines.  Unlike in any of the shells, single
      ^^^^^^^^^^^^^^^^^^^^^^^^
   ...
----------------------


: Why can't I see the newline
: as a symbol or something?


The standard on-screen representation for a newline is to move to
the next line  ;-)

It *is* moving to the next line, right?

If you can't tell, then maybe you want to "wrap" the output with something
so that it will be easier to see the whitespaces:

   print "'$date'\n";  # bracket it with single quotes, for example


: I saw the Perl motto saying "There's more than one way to do it" and
: maybe there is another way...

Of course, but chomp() is best (for removing newlines. localtime() is
best for getting the date):

   $date =~ s/\n//;

   substr($date, length($date)-1) = '';


: I'm in desperate need of help to solve my problem. Help!!

Want the answer in a few seconds? 

Or do you want to post and wait anywhere from a few minutes to infinity?


Use the docs, Luke.  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Thu, 14 Aug 1997 08:43:58 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
To: Masoud M-Kho'i EHS/LI 80441 3322 <ehsmakh@aom.ericsson.se>
Subject: Re: need help with perl and dates
Message-Id: <33F2FD8D.65FFD980@glaxowellcome.com>

Hello,

    To remove the newline, do
    chop($date=`date '+%y%m%d'`);

    Why is there a newline? The `date '+%y%m%d'` does an OS UNIX date
command.
    The date command adds the newline.
    If you're on a machine without a UNIX date like command, like NT
this won't work.

    A more portable way is:
$t = formatTime( localtime( time ) );
print "\n $t ";

$t = formatTime( gmtime( time ) );
print "\n $t ";

sub formatTime{
 my ($sec, $min, $hour, $monthDay, $month, $year,
  $weekDay, $yearDay, $isDst ) = @_;

 my $nameMonth =
  (qw(JAN FEB MAR APR MAY JUN JUL AUG SEP OUT NOV DEC))[$month];

 return sprintf( "%2.2d-%s-%2.2d%2.2d %2.2d:%2.2d:%2.2d", $monthDay,
$nameMonth, '19', $year, $hour, $min, $sec);
}

Why can't I see the newline as a symbol or something? Here's a quick sub

to show newlines.

$s = "12345\n12345";
$t = showCRs( $s );
print "$t";

sub showCRs{
 my $s = shift;

return  $s =~ s/\n/#nl#/g;
}

Hope this helps...
Thad

Masoud M-Kho'i EHS/LI 80441 3322 wrote:

> Hi,
>
> I'm a beginner with perl and now I'm constructing webpages with perl.
> Poweful language but I have run into problems which I can't find a
> solution to. I want to fetch the date from the computer time and
> assign
> it to a variable. I'm just interested in the date. I found out one way
>
> to do it:
>
> $date=`date '+%y%m%d'`;
>
> It works fine except that a newline is inserted in the end and it's
> essential for me not to have the newline there.
> What to do instead? Why is there a newline? Why can't I see the
> newline
> as a symbol or something?
> I saw the Perl motto saying "There's more than one way to do it" and
> maybe there is another way...
>
> I'm in desperate need of help to solve my problem. Help!!
>
> Regards,
> Masoud M. Kho'i
> Ericsson Hewlett Packard Telecommunications
> Sweden
>
> \





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

Date: 14 Aug 1997 06:35:08 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: Newbie ?? Can PERL scan for substrings from serial port data?
Message-Id: <8cvi18ubub.fsf@gadget.cscaper.com>

>>>>> "Matthew" == Matthew Cravit <mcravit@shell3.ba.best.com> writes:

Matthew> This is possible to do with perl, using the chat2.pl library
Matthew> which is part of the standard distribution.

As of 5.004, chat2.pl (the "alpha" release :-) is no longer being
distributed with Perl, at *my* request.

Use Comm.pl and Net::Telnet instead... good stuff there.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 383 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 14 Aug 1997 11:17:04 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: Parser for CSS?
Message-Id: <5supfg$7in$5@news1.sol.no>

In article <1997081323101058618@rhrz-isdn3-p11.rhrz.uni-bonn.de>,
	uzs90z@uni-bonn.de (Michael Schuerig) writes:

> Has someone already written a parser for cascading style sheets?

  Whether you would count it as a parser I do not know, but the WDG has
a 'lint' online. You can find that at http://www.htmlhelp.com/.

  (Yes, right *now* our server is down. I'll kick something.)


--
 Tina Marie Holmboe                          tina@mail.scandinaviaonline.se

 The opinions expressed above are mine, and should in no way or under any
 circumstances be associated with Scandinavia Online AB unless this disclaimer
 is explicitly revoked.


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

Date: Thu, 14 Aug 1997 09:46:28 +0200
From: Pinne <pegit.swedmap@mbox300.swipnet.se>
Subject: Perl 5 permanently loaded
Message-Id: <33F2B7D4.7DA7@mbox300.swipnet.se>

Hi Perlgurus,

I've read that some NT web-servers can keep Perl 5
in memory permanently.
I'm using Activewares Perl 5.003 bld 306 on NT S 4.0
with IIS 3.0.
Using PerlIS for the moment but have some problems with it.
This feature would lessen the need for PerlIs wouldn't it ?
Does anyone know if IIS 3.0 can keep Perl.exe in memory
permanently ?
Gratefull for any answer.
/regards


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

Date: Wed, 13 Aug 1997 23:21:50 -0400
From: Mike Turk <mturk@westonia.com>
Subject: Re: Perl and Windows NT
Message-Id: <33F279CE.43A9@westonia.com>

Barry Andre wrote:
> 
> Hello,
> 
> I want to implement CGI-Scripts for receiving forms in webpages on my
> webserver.
> 
> But I do not know how to do this.
> 
> How must I install Perl on my Windows NT 4.0 Server ?
> Where can I get ready to use CGI-scripts for my server ?
> 
> Can anyone help me ?
> 
> Thanks,
> 
> Barry Andre
> please mail back at: bandre@xs4all.nl
I managed to do it with the help of the FAQ at
http://www.perl.hip.com/FAQ/
As far as scripts go just do search on perl and you'll find scripts
galore!
Mike Turk
mturk@westonia.com


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

Date: 14 Aug 1997 04:02:04 GMT
From: mdkail@fv.com (Mike D. Kail)
Subject: Re: perl process problem
Message-Id: <slrn5v50vh.rdn.mdkail@dime.fv.com>

On Tue, 12 Aug 1997 15:04:08 -0400, Wei Zhou <wzhou@ai.iit.nrc.ca> wrote:
>I'm having a problem with a perl multiprocesses program.
>
>my perl program usually stops right at fork or wait with no error
>message.
>
>does anyone know what's wrong?
>
>thanks in advance.

first, comp.lang.perl no longer exists, and hasn't for quite some time

second, HTH do you expect anyone to answer such a terse question?  you've
posted *no* code examples, etc...

if you expect someone to help you, then please at least have the courtesy
to formulate an intelligent, detailed question

-- 
/*-------------------------------------------------------------*/
/*  Mike D. Kail                    |  voice:  (619) 350-3524  */
/*  Unix System Architect           |  fax:    (619) 793-2950  */
/*  FIRST VIRTUAL Holdings Inc.     |  e-mail: mdkail@fv.com   */
/*-------------------------------------------------------------*/



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

Date: Thu, 14 Aug 1997 13:22:11 +0200
From: Pinne <pegit.swedmap@mbox300.swipnet.se>
Subject: Perl.exe vs PerlIS.dll on NT S 4.0
Message-Id: <33F2EA63.1E78@mbox300.swipnet.se>

Hi again Perlgurus !

Trying to run Perl.exe 5.003 bld 307 on NT S 4.0 w IIS 3.0.
BUT IT JUST WON'T WORK.
PerlIS seems to work ok, but the bloody exe just won't catch.
Any suggestions ?


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

Date: Mon, 11 Aug 1997 09:42:44 -0400
From: Kevin Chin <kchin@nva.lmco.com>
Subject: Setting Groupid
Message-Id: <Pine.SUN.3.96.970811094047.8595B-100000@s390server>

Hello,

About a week ago, I posted a question to this group about setting the
groupid within Solaris Perl.  I got some responses.  Thank you.  However,
I took the advice, recompiled perl to implement setrgid() and it still
does not work.

I was wondering if anyone has been successful in setting the groupid on a
Solaris 2.5 system using perl.  Please let me know.  Thanks.

Kevin Chin
kchin@nva.lmco.com




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

Date: Thu, 14 Aug 1997 10:09:47 +0930
From: "Steven Goldsmith" <spg@corporatenet.net.au>
Subject: Socket error using IIS and perl with NT
Message-Id: <5stk8s$3jt$1@perki.connect.com.au>

 I am hoping someone can help me with a problem I seem to be getting using a
Sendmail library under Windows NT 4.0. I have everything installed correctly
as I believe however when we post information to a for we get the following
error
Error Occured: Can't connect socket:Unknown Error: 0x00002741

If someone could help me with this problem I would be most appreciative. If
you require further information including maybe the code please let me know.
<newbie>

Steven Goldsmith
http://www.corporatenet.net.au
spg@corporatenet.net.au


>






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

Date: 14 Aug 1997 12:03:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Someone Want a Challenge?
Message-Id: <5sus7d$7ks@fridge-nf0.shore.net>

Ranson (ranson@infoave.net) wrote:

: Hi all,    I have a counter statistic program that is driving me nuts!  The 
: log file [ CountLogs/today.log ] keeps erasing itself, starting the
: count over. 

WWW or not - if you're having multiple people writing to a file
concurrently, you've got to use flock(), documented in the perlfunc
manpage or _Programming Perl, Second Edition_.  Your .lockfile
creation should be replaced with an flock() call.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Thu, 14 Aug 1997 07:56:17 -0400
From: Anagrams of the Word  <jefpin@bergen.org>
To: Pat Trainor <ptrainor@aura.title14.com>
Subject: Re: sorting...
Message-Id: <Pine.SGI.3.95.970814075309.20834A-100000@vangogh.bergen.org>

>while (($key, $value) = each(%MAIN_CHOICES)) {
>        print "$key has a value of $value\n <br>";
>}
>
>	The output is unsorted.
>
>	What is the best way to sort the output by either key or value? Do I need to
>port the output through sort and build another array? Sorry for the newbie question!

foreach (sort keys %MAIN_CHOICES){
	print "$_ has a value of $MAIN_CHOICES{$_}\n <br>";
}

That sorts alphabetically by keys.


foreach (sort values %MAIN_CHOICES){
	print "$MAIN_CHOICES{$_} has a value of $_\n <br>";
}

That sorts alphabetically by values.



----------------
| Before you think UNIX is family-oriented, note that all children must die. 
| 	- Cross-Platform Perl
----------------
Jeff "TechMaster" Pinyan | http://users.bergen.org/~jefpin
I do: HTML!! CGI!! Perl!! JavaScript!! jefpin@bergen.org
Got a JavaScript/CGI/Perl question or problem?  Let me know!

webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS



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

Date: 13 Aug 1997 22:30:06 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Trouble building SCO dynamic loading ...
Message-Id: <5su54u$2ib$1@lennon.postino.com>

Jar Lyons (jarl@atrieva.com) wrote:
: I can't seem to get the dynamic loading to build on SCO.
: For whatever reason, Configure chooses dl_none.xs as 
: the Dynaloader source, which is simply a no-op set of routines.
: I read in the Dynaloader directory that it may be necessary
: to create a version of dl_???.xs pertinent to the 
: intended OS, unless your OS just happens to be one of 
: the 1/2 dozen or so supplied in the base perl package:
: dl_aix.xs     dl_dlopen.xs  dl_next.xs    dl_os2.xs
: dl_dld.xs     dl_hpux.xs    dl_none.xs    dl_vms.xs
: Has anyone successfully built a dynamically loading version?

If you look at ftp.sco.com in the SKUNK96 or SKUNK2 directory,
there is a perl binary package that was built with dynamic 
loading. Since source is included, you can look at their hints
file and see what they did to build it. I have used the package
and did a complete build with no trouble. But, when I tried to
dynamically link in some modules, (Specifically GD), I never could
get it to dynamically load. But the package should get you started.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 13 Aug 1997 22:38:53 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: version of Perl5 for NT4
Message-Id: <5su5ld$2nv$1@lennon.postino.com>

John Scriven (scrivenaj@cv.port.ac.uk) wrote:
: I am looking for a vesion of Perl working under NT4.
: I haven't found anything on the homepage of Perl.

I think this is because Tom C hates Microsoft. But a web
search should have pointed you to www.activeware.com , where
you can get Pw32i307.exe  and you will be away to the races.

: by the way any explanations, tips or links about how to install
: Perl on NT4 for is welcome.

Just run the executable. If you get braver you can go to 
www.cygnus.com and download their gcc dev kit. Then with some
patches & a bit of hacking, it is possible to roll your own
perl5.004_1 .

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: Thu, 14 Aug 1997 09:05:11 -0400
From: Arwen Mullikin <arwen.mullikin@transquest.com>
Subject: Year 2000 compliant?
Message-Id: <33F30287.56BA@transquest.com>

I am doing a research project and one of the questions was to find out
if the latest version of Perl was Year 2000 compliant. Does anyone know
where I can get that information?

Thanks,
Arwen


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 865
*************************************

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