[10581] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4173 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 7 13:07:15 1998

Date: Sat, 7 Nov 98 10:00:19 -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           Sat, 7 Nov 1998     Volume: 8 Number: 4173

Today's topics:
        a small question <S141608376@ntu.edu.sg>
    Re: a small question <rootbeer@teleport.com>
    Re: Compilation error in /cgi-bin/feedback.cgi imchat@ionet.net
    Re: Compilation error in /cgi-bin/feedback.cgi <rootbeer@teleport.com>
    Re: Help on version 4/5 -- I did it their.. way... <rwilliamson@uno.gers.com>
    Re: How: C macro in a extension <fox@vulpes.com>
    Re: Index of an element in a list? (Tad McClellan)
        Installation Help <mikane@shell3.ba.best.com>
    Re: Installation Help <erich@orator.usma.edu>
    Re: Installation Help <erich@orator.usma.edu>
    Re: Making debugging methods work in a CGI environment <rootbeer@teleport.com>
        opendir() VS glob - WAS Re: readdir bug in win95 perl 5 <dtbaker-@busprod.com>
        Perl module problem, please help!! <julius@clara.net>
    Re: Perl Warning Message? (Tad McClellan)
        Perl2exe <yk08@dial.pipex.com>
    Re: PLEASE HELP! (Gord Barentsen)
        RE:a small question <r28629@email.sps.mot.com>
        split and replace????? <ours@casema.net>
    Re: split and replace????? <sutton@lynxus.com>
    Re: split and replace????? (Tore Aursand)
    Re: split and replace????? (Tad McClellan)
    Re: split and replace????? <r28629@email.sps.mot.com>
    Re: split and replace????? <r28629@email.sps.mot.com>
        start a programm with exit(); <euhost@euhost.com>
    Re: start a programm with exit(); (Tad McClellan)
    Re: Sx Hello World problem <sutton@lynxus.com>
    Re: Web_store question <info_net@globalnet.co.uk>
    Re: Why single iterator over each hash? <rootbeer@teleport.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 7 Nov 1998 16:23:17 +0800 
From: #YE XIANGZHOU# <S141608376@ntu.edu.sg>
Subject: a small question
Message-Id: <D0BE198B1C7ED111AD1808002BA613F8062818CE@mail1.ntu.edu.sg>

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BE0A27.DF51691F
Content-Type: text/plain

How to tell whether a number or string is stored in a scalar variable?

------_=_NextPart_001_01BE0A27.DF51691F
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2232.0">
<TITLE>a small question</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>How to tell whether a number or string is stored in a scalar variable?</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01BE0A27.DF51691F--



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

Date: Sat, 07 Nov 1998 17:31:30 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: a small question
Message-Id: <Pine.GSO.4.02A.9811070931151.21718-100000@user2.teleport.com>

On Sat, 7 Nov 1998, #YE XIANGZHOU# wrote:

> How to tell whether a number or string is stored in a scalar variable?

See the FAQ. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 07 Nov 1998 14:06:13 GMT
From: imchat@ionet.net
Subject: Re: Compilation error in /cgi-bin/feedback.cgi
Message-Id: <364453a5.61445864@news.ionet.net>

Make sure your logfile is in the right directory with permission set
to 666.


On Sat, 07 Nov 1998 05:00:53 GMT, cyrnos@my-dejanews.com wrote:

>My perl script was created and run free of error with "Perl Builder".
>Since it's my first i guess i missed something on the server side even though
>the permission are set to:  r w x     r - x      r - x and i uploaded using
>ASCII format. Can somebody help?
>I try with 2 different servers/cgi-bin directories and in the first one i get
>this error message:
>
>Compilation error in /cgi-bin/feedback.cgi
>
>failed to open log file
>fopen: Permission denied
>
>On the other server i get this messages:
>Compilation error in /cgi-bin/feedback.cgi
>Thx
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



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

Date: Sat, 07 Nov 1998 17:29:47 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Compilation error in /cgi-bin/feedback.cgi
Message-Id: <Pine.GSO.4.02A.9811070928150.21718-100000@user2.teleport.com>

On Sat, 7 Nov 1998 imchat@ionet.net wrote:

> Make sure your logfile is in the right directory with permission set
> to 666.

But first, learn enough about Unix to know why you don't usually want the
permissions of a directory set to 666. 

If you have further questions about Unix and file permissions, the docs,
FAQs, and newsgroups about Unix should be helpful. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 7 Nov 1998 07:03:58 -0800
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Re: Help on version 4/5 -- I did it their.. way...
Message-Id: <bhZ02.131$DA6.25251@news.connectnet.com>

Thank all of you for the responses.  Regarding ' systems  vulnerable to
crackers'. Salteen? :-)  They're all behind a firewall and serve only our
Intranet.

Regarding Perl versions -- actually I'm surprised that I did not get a
response echoing what my company's PUG decided on.  We did hit some
compatibility issues and we have tons of Perl4 scripts out there -- too many
to try and update (besides, there's no ROI on fixing things that arent
broken!).  At any rate leaving perl4 '#!/usr/bin/perl' and doing
'#!/usr/bin/perl5' and doing '#!/usr/bin/perl6' whenV6 comes out makes sense
when you think about it.

Again, thanks for your replies -- this news group is awesome for a baby
'ouster' like myself.

Rusty


Rusty Williamson wrote in message ...
>Hi!
>I've hit a little problem -- on the dozen or so servers we have at work,
>/usr/bin/perl on some systems is version 5, while on others its version 4
>and version 5 is /usr/bin/perl5.  We have tons of v4 scripts all starting
>out with #!/usr/bin/perl.  What are people doing?
>
>Rusty
>
>
>
>
>




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

Date: Sat, 07 Nov 1998 12:44:10 -0500
From: Ken Fox <fox@vulpes.com>
Subject: Re: How: C macro in a extension
Message-Id: <364486EA.C5C599E1@vulpes.com>

Anatol Filin wrote:
> I need some piece of Perl code to be #ifdef -ed
> in a extension module.

The Makefile.PL can pre-process your module during
installation.  I just named my module *.in and then wrote
a custom rule to convert *.in to *.pm by running cpp.
The cpp command is a Config variable so the rule is
generic across systems.

I've only done this once so I'm not sure if it's the
best way.  If I were to do this over again, (always
time to do it twice, never time to do it right ;)
I'd probably break the module up into platform-specific
sub-modules and just BEGIN { require } the right one
at run time.  This approach is more flexible and more
often correct considering that people often expect
Perl code to be trivially portable.

- Ken


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

Date: Sat, 7 Nov 1998 09:45:29 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Index of an element in a list?
Message-Id: <pup127.71d.ln@flash.net>

Colin Kuskie (ckuskie@cadence.com) wrote:
: On 6 Nov 1998, Awrobinson wrote:

: > Is there a built-in or effiecient way to determine the index of an
: > element in a list? I used the lindex[] function all the time in tcl,
: > but I cannot find an equivalent in perl. I know I can build one with a
: > for loop or a foreach loop and a counter, but that seems inefficient.
: > It would really come in handy for the project I'm working on now.

: I'm going to make the dangerous carte-blanche statement:

: "Unless your data is sorted, there is no way to improve on the linear
                       ^^^^^^
                       ^^^^^^  s/sorted/ordered/;
: search."

: Think about it.  Most search algorithms, like binomial depend on the
: fact that given information about the current point you can determine
: where you want to go next.  This implies an order to the data.
                                              ^^^^^^^^^^^^^^^^^

You obviously already knew that. But you did not say that ;-)


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


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

Date: 07 Nov 1998 17:05:31 GMT
From: <mikane@shell3.ba.best.com>
Subject: Installation Help
Message-Id: <36447ddb$0$12754@nntp1.ba.best.com>

I am trying to compile/install Perl5.005_02. on Solaris x86.
First I installed a pre-compiled compiler package (gcc).

On the Perl distribution I ran "sh Configure -Dcc=gcc" and
that executed without a hitch. 

When I ran "make" I got the message "/make: not found."

What can be the problema?

Mike


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

Date: Sat, 07 Nov 1998 12:53:50 -0500
From: "Erich L. Markert" <erich@orator.usma.edu>
To: mikane@shell3.ba.best.com
Subject: Re: Installation Help
Message-Id: <3644892E.1FEE1D72@orator.usma.edu>

Need to get yourself GNUmake for solaris as well.

mikane@shell3.ba.best.com wrote:
> 
> I am trying to compile/install Perl5.005_02. on Solaris x86.
> First I installed a pre-compiled compiler package (gcc).
> 
> On the Perl distribution I ran "sh Configure -Dcc=gcc" and
> that executed without a hitch.
> 
> When I ran "make" I got the message "/make: not found."
> 
> What can be the problema?
> 
> Mike

--
__________________________________________________________
Mr. Erich L. Markert                 erich@orator.usma.edu
USMA Webmaster                           TEL (914)938-6463
Directorate of Information Management    FAX (914)938-7308
United States Military Academy
West Point, NY 10996

"If you put three drops of poison into a 100 percent pure Java, 
you get ... Windows. If you put a few drops of Java into Windows, 
you still have Windows."
		-- Sun Microsystems CEO, Scott McNealy


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

Date: Sat, 07 Nov 1998 12:54:06 -0500
From: "Erich L. Markert" <erich@orator.usma.edu>
Subject: Re: Installation Help
Message-Id: <3644893E.B92E0D87@orator.usma.edu>

Need to get yourself GNUmake for solaris as well.

mikane@shell3.ba.best.com wrote:
> 
> I am trying to compile/install Perl5.005_02. on Solaris x86.
> First I installed a pre-compiled compiler package (gcc).
> 
> On the Perl distribution I ran "sh Configure -Dcc=gcc" and
> that executed without a hitch.
> 
> When I ran "make" I got the message "/make: not found."
> 
> What can be the problema?
> 
> Mike

--
__________________________________________________________
Mr. Erich L. Markert                 erich@orator.usma.edu
USMA Webmaster                           TEL (914)938-6463
Directorate of Information Management    FAX (914)938-7308
United States Military Academy
West Point, NY 10996

"If you put three drops of poison into a 100 percent pure Java, 
you get ... Windows. If you put a few drops of Java into Windows, 
you still have Windows."
		-- Sun Microsystems CEO, Scott McNealy


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

Date: Sat, 07 Nov 1998 16:38:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Making debugging methods work in a CGI environment
Message-Id: <Pine.GSO.4.02A.9811070837170.21718-100000@user2.teleport.com>

On Fri, 6 Nov 1998, Aravind Subramanian wrote:

> Put another way, output to stdout becomes output to browser after
> piping through a HTML conversion filter.

Sounds like something you could do with a tied filehandle. Hope this
helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 07 Nov 1998 10:39:00 -0600
From: Dan Baker <dtbaker-@busprod.com>
Subject: opendir() VS glob - WAS Re: readdir bug in win95 perl 5.00402?
Message-Id: <364477A4.7C0F4C05@busprod.com>

Tom Phoenix wrote:
> 
> On Fri, 6 Nov 1998, Dan Baker wrote:
> 
> > The problem is that I'm using readdir to grab a listing of a
> > directory, and the attributes of the items doesn't seem to be getting
> > read correctly if I opendir() anywhere other than the current working
> > dir where the test script is being executed.
> 
> If you're asking for -d 'fred', you're talking about fred in the current
> directory, of course. If you mean -d '/some/other/dir/fred', say so. Hope
> this helps!
-------------------------------------

aha.... I think I was up too late and missed the obvious on that one.
For some reason I was thinking that all the -d -e -f type tests would
automagically know what directory I was looking at from the prior use of
opendir(). Makes sense now that they look at the current working dir.

This DOES bring up a question that you may be able to shed some light
on... for many uses I can think of you would need to use chdir() in
combination with opendir()/readdir()/closedir() to be able to do things
like file testing, etc. So, the question is... why would you choose to
use opendir() rather than just glob<>? Are there speed or other
advantages/disadvantages?

Thanx,
Dan

# If you would like to reply-to directly, remove the - from my username
* no spam please... regulated by US Code Title 47, Sec.227(a)(2)(B)  *


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

Date: Sat, 7 Nov 1998 15:20:05 -0000
From: "Jules" <julius@clara.net>
Subject: Perl module problem, please help!!
Message-Id: <721t9p$smq$1@eros.clara.net>

Dear all, I'm trying to write a Perl 5 module to write some XML based
markup language tags to separate files. Say I would have something like
this in the source perl script:
-------------------------------------------------------------------------
# I created a directory c:\perl\lib\Xml\ and there are File.pm and
Graphics.pm
use Xml::File;
use Xml::Graphic;

$file = newFile();                                        # create a new
file object
$g = newGraphic();                                   # init a graphics
object
$file->openFile(\*OUT, "file1.xml");         # open a file (OUT,
">file1.xml")
$g->drawText(\*OUT, "Hello World!");    # print a line of text using xml
convention
$file->closeFile(\*OUT, "file1.xml");         # close the filehandle
-------------------------------------------------------------------------
I'm now passing OUT into every method but in fact I only want to pass OUT
into openFile() as a reference once and it would then use the same OUT
throughout the life of $file object, that means I want drawText(),
openFile() and closeFile() to use the SAME filehandle OUT passed in in the
source script. I've tried something like this in the module files:-
-------------------------------------------------------------------------
# File.pm
package Xml::File;
require 5.000;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(newFile openFile closeFile *fh);

local *fh;

sub newFile {
    my $class = shift;
    my $self = {};
    bless ($self, $class);
    return $self;
}

sub openFile {
    *fh = shift;
    open (fh, ">".$_[1]);
    print fh "<?xml version=\"1.0\"?>\n<!DOCTYPE xml SYSTEM
\"xml.dtd\">\n";
    print fh "<xml " . $_[2] . ">\n";
}

sub closeFile {
    *fh = shift;
    print fh "</xml>";
    close (fh);
}

1;
-------------------------------------------------------------------------
# Graphics.pm
package Xml::Graphic;
require 5.000;
import Xml::File;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(newGraphic drawRect);

sub newGraphic {
    my $class = shift;
    my $self = {};
    bless ($self, $class);
    return $self;
}

sub drawRect {
    *fh = shift;
    print fh "\t<rectangle x=\"$_[1]\" y=\"$_[2]\" width=\"$_[3]\"
height=\"$_[4]\" fillcolor=\"$_[5]\" />\n";
}

1;
-------------------------------------------------------------------------
It surely works. But the thing is I have to pass in the filehandle \*OUT
everytime I call each of these functions, is there a way to just pass it to
openFile() and then all other corresponding functions that needs a
filehandle would use the same OUT? Besides, the way I did it is that I
declared a glocal pointer "local *fh" in File.pm and then export it to
Graphic.pm, so Graphic.pm would use the same *fh. But the thing is, since
*fh is global, then if I try to open 2 files one after another and write to
each of them, I will only get all the output into ONE single file (the
second one being initialised) cos' every time File.pm is called to init an
object, *fh will be assigned to that particular filehandle, overwriting the
previous one. So if I try doing this:
-------------------------------------------------------------------------
use Xml::File;
use Xml::Graphic;

$file1 = newFile();                                        # create a new
file object
$file2 = newFile();
$g1 = newGraphic();                                   # init a graphics
object
$g2 = newGraphic();
$file1->openFile(\*OUT1, "file1.xml");       # open a file (OUT,
">file1.xml")
$file2->openFile(\*OUT2, "file2.xml");
$g1->drawText(\*OUT1, "Hello One!");    # print a line of text using xml
convention
$g2->drawText(\*OUT2, "Hello Two!");
$file1->closeFile(\*OUT, "file1.xml");         # close the filehandle
$file2->closeFile(\*OUT, "file2.xml");
-------------------------------------------------------------------------
I will get BOTH lines "Hello One!" and "Hello Two!" in file2.xml cos' OUT2
overwrites OUT1 when File.pm is called when initialising $file1 and then $f
ile2. How do I fix the fault? And how do I NOT have to pass in the
filehandle everytime? Please help.

I know this is a very long question, but it would be deeply appreciated if
anyone can offer help.

Thank you so much,
                             Julius

***There is not enough darkness in the whole world to extinguish the light
of a small candle***




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

Date: Sat, 7 Nov 1998 10:06:10 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl Warning Message?
Message-Id: <i5r127.q4d.ln@flash.net>

Abdul Ali (aali@ix.netcom.com) wrote:

: I'm getting the following Perl warning message: "Use of initialized
: value at fix_it line xx". The "xx" line is:
: $curr = join(/["]/, @FIELDS);.
               ^^^^^

   this is equivalent to:

      $_ =~ /["]/

   have you put a value into the $_ special variable?


   It is pretty strange to use a pattern match as your join()
   expression though. I have no idea what you might really want
   here.

   Do you want to put a double quote between each array element?

   Or a double quote inside of square brackets?

   Or double quotes _surrounding_ each element?

   ???


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


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

Date: Sat, 7 Nov 1998 13:49:49 -0000
From: "Chris Liley" <yk08@dial.pipex.com>
Subject: Perl2exe
Message-Id: <721jb9$2sp$1@plug.news.pipex.net>

Trying to use Perl2exe I keep getting the error message:

Warning: module Carp not found
Make sure that the perl\bin directory is in your path

My path is as follows:
PATH=C:\PERL\5.005\BIN\MSWIN32-X86-OBJECT;C:\PERL\5.005\BIN;C:\WINDOWS;C:\WI
NDOWS\COMMAND

Which I think includes the relevant perl\bin !

Further the script runs fine prior to compiling so Perl knows where to find
the modules.  The modules are included via the "USE" statement.

Is the directory your are in when calling perl2exe relevant ?  I am calling
it from the directory I keep the script in, should I be in the BIN directory
?

Any help appreciated,


Chris Liley




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

Date: Sat, 07 Nov 1998 16:49:41 GMT
From: gpb@ppaolucci.com (Gord Barentsen)
Subject: Re: PLEASE HELP!
Message-Id: <364577cf.3499268@news.the-wire.com>

On Fri, 6 Nov 1998 12:11:22 GMT, Brent Michalski
<perlguy@technologist.com> wrote:

>Can you provide us with a code example and let us know what OS you are
>running Perl on?
>
>Also, read one of Tom Phoenix's posts about "subjects".  He has some
>good pointers. (Hi Tom)
>
>Brent

	In response to Troy Denkinger's and Brent Michalski's posts
regarding my question, here is the simple Perl code that is giving me
troubles (with comment-outs snipped for convenience).  Also, please
note below the REQUIREd .pl files as well  I am running the Server on
Win95 version A (yeah, I know) with an updated version of DCOM to
support the SS:

------------------------------------------------------------------------
HELLOWWW.PL

#! d::\Program Files\sambar41\perl\perl.exe

# hellowww.pl

require "htmlhead.pl";
require "htmlend.pl";

print "Content-type: text/html","\n\n";

&HTML_Header ("If you are reading this, then it works!");

print "<body bgcolor=blue><font face=Arial size=3 color=yellow>","\n";
print "<h1>Hello, World!</h1>","\n\n";
print "</font>","\n";

&HTML_Footer;

#	END HELLOWWW.PL


------------------------------------------------------------------------
HTMLHEAD.PL

#!d:\Program Files\sambar41\perl\perl.exe

sub HTML_Header

{
	print "\n","<HTML><HEAD>","\n\n";
	print "<title>",@_,"</title>","\n\n";
	print "</HEAD>","\n\n";

}	

#END HTML_Header


------------------------------------------------------------------------
HTMLEND.PL

#! d:\Program Files\sambar41\perl\perl.exe

sub HTML_Footer
{
	print "\n","</BODY></HTML>","\n";
}	

#END HTML_Footer
-----------------------------------------------------------------------

	Now, when I run this through the Sambar server and point the
browser to the first file through the localhost, NS will give me
"Transferring data from localhost" and spiral off into oblivion.  If I
hit STOP, the page will change and I will get "Transfer Interrupted"
on the new screen.  IE will complete the load but nothing will happen
- blank white screen.
	Hope this puts things in perspective; thanks in advanced for
your time and help!

Gord Barentsen



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

Date: Sat, 07 Nov 1998 11:06:43 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: #YE XIANGZHOU# <S141608376@ntu.edu.sg>
Subject: RE:a small question
Message-Id: <36447011.EB297651@email.sps.mot.com>

[posted to comp.lang.perl.misc and copy emailed]

> How to tell whether a number or string is stored in a scalar variable?

Perl uses strings and numbers interchangably, converting them from one to the
other automatically when need. It make people like C-programmers worry, but it
really doesn't matter. After all, numbers are just some forms of string.

If you _really_ want to tell (why?) if the variable is a number (or string
with 0,1... etc), use something like:

   print 'is an integer' if $var =~/^\d+$/;

BTW, please don't post in html format. Also, somehow trying to reply to your
post crashed by browser twice.

-tk


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

Date: Sat, 7 Nov 1998 14:00:32 +0100
From: "Casema" <ours@casema.net>
Subject: split and replace?????
Message-Id: <721gbf$l9v$1@sun4000.casema.net>

hi group,

A simple question, requires a simple answer, I hope.
What would be the valid code for:

$result = $a + $b;

if $a would contain: "Hello "
   $b would contain: "World"
and I want $Result to contain "Hello World"

(???)

thanks,

Michel




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

Date: Sat, 7 Nov 1998 09:31:08 +0100
From: "CS" <sutton@lynxus.com>
Subject: Re: split and replace?????
Message-Id: <n1Y02.3111$ys2.1148974@news2.randori.com>

You can use

$a = "Hello";
$b = "World";
$result = $a . " " . $b;


Casema wrote in message <721gbf$l9v$1@sun4000.casema.net>...
>hi group,
>
>A simple question, requires a simple answer, I hope.
>What would be the valid code for:
>
>$result = $a + $b;
>
>if $a would contain: "Hello "
>   $b would contain: "World"
>and I want $Result to contain "Hello World"
>
>(???)
>
>thanks,
>
>Michel
>
>




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

Date: Sat, 07 Nov 1998 13:49:47 GMT
From: tore@forumnett.no (Tore Aursand)
Subject: Re: split and replace?????
Message-Id: <36444fc0.249559347@news.online.no>

On Sat, 7 Nov 1998 14:00:32 +0100, "Casema" <ours@casema.net> wrote:
> $result = $a + $b;
>
> if $a would contain: "Hello "
>    $b would contain: "World"
> and I want $Result to contain "Hello World"

You could try:

    $result = $a . " " . $b;

 ...or:

    $result = "$a $b";


-- 
Tore Aursand
ForumNett Online AS
http://www.forumnett.no/


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

Date: Sat, 7 Nov 1998 09:59:15 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: split and replace?????
Message-Id: <joq127.71d.ln@flash.net>

Tore Aursand (tore@forumnett.no) wrote:
: On Sat, 7 Nov 1998 14:00:32 +0100, "Casema" <ours@casema.net> wrote:
: > $result = $a + $b;
: >
: > if $a would contain: "Hello "
                               ^
                               ^ one space here
: >    $b would contain: "World"
: > and I want $Result to contain "Hello World"
                                        ^
                                        ^ one space here

: You could try:

:     $result = $a . " " . $b;
                      ^
                      ^ two spaces between words now

: ....or:

:     $result = "$a $b";
                   ^
                   ^ two spaces between words now


Thanks for trying to help. But neither answer does what was asked for...



 ... or replace the numeric operator in the original statement
     with a string operator that does concatenation:


   $result = $a . $b;


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


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

Date: Sat, 07 Nov 1998 09:14:21 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Casema <ours@casema.net>
Subject: Re: split and replace?????
Message-Id: <364455B1.38AE2736@email.sps.mot.com>

[posted to comp.lang.perl.misc and copy emailed]
Casema wrote:
> 
> hi group,
> 
> A simple question, requires a simple answer, I hope.
> What would be the valid code for:
> 
> $result = $a + $b;
> 
> if $a would contain: "Hello "
>    $b would contain: "World"
> and I want $Result to contain "Hello World"

you post subject is 'split and replace', what is that you want to split or replace?

-tk


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

Date: Sat, 07 Nov 1998 09:11:10 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: split and replace?????
Message-Id: <364454F2.AB5C2259@email.sps.mot.com>

Tore Aursand wrote:
> 
> On Sat, 7 Nov 1998 14:00:32 +0100, "Casema" <ours@casema.net> wrote:
> > $result = $a + $b;
> >
> > if $a would contain: "Hello "
                               ^
                          space already here

> >    $b would contain: "World"
> > and I want $Result to contain "Hello World"
> 
> You could try:
> 
>     $result = $a . " " . $b;
> 
> ...or:
> 
>     $result = "$a $b";


Not quite as simple. <sigh>

-tk


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

Date: Sat, 07 Nov 1998 13:00:13 +0100
From: Matevz Sernc <euhost@euhost.com>
Subject: start a programm with exit();
Message-Id: <3644364D.D772EAEE@euhost.com>

Hi

i want to start a program in my cgi with the perl command "exit". 
Yes i know that it never returns, but thats what i want. 

exit("rundig"); will should run in background for 1-2 hours, so i cant
start it with system, because i also do not want to return me something.

But my PROBLEM is that the called program cant run with the browsers
"nobody" user. 
I must start the "rundig" with my full login/pass, is this possible ??

Thank you very much
Matevz Sernc


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

Date: Sat, 7 Nov 1998 10:07:30 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: start a programm with exit();
Message-Id: <28r127.q4d.ln@flash.net>

Matevz Sernc (euhost@euhost.com) wrote:

: i want to start a program in my cgi with the perl command "exit". 
                                                             ^^^^   eh?
: Yes i know that it never returns, but thats what i want. 


   exit() exits.

   exec() runs a program and never returns.


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


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

Date: Sat, 7 Nov 1998 09:42:16 +0100
From: "CS" <sutton@lynxus.com>
Subject: Re: Sx Hello World problem
Message-Id: <QbY02.3113$ys2.1152791@news2.randori.com>

You did not say what platform you are running on.  I have gotten Sx to work
on HP-UX, but had to build the shared library manually.

You might also look into Xforms4Perl (it also requires Xforms to be
installed).  It has a gui form builder that will generate the perl code to
create the forms.  It works very well and has much more functionality than
Sx.

Chip Sutton
CSNet Consulting


Kjetil Kjernsmo wrote in message <71fpm7$8hp$1@readme.uio.no>...
>Hi folks!
>
>I have just tried to install Sx on my system, because somebody said it
>was easier than Tk. Not without trouble, first I had to remove all the
>Xaw3d-stuff I could find. Then, I haven't got access to the normal
>installation directories, and I didn't want to bother my sysadm with
>this stuff, so I installed it to a subdir of my home directory. The
>installation seemed to go smoothly after those two modifications.
>
>However, I'm unable to run the Hello world-program mentioned in the
>manpage...! Doesn't sound good, eh...
>
>If I run
>
>#! /local/bin/perl5
>use Sx;
>
>OpenDisplay(@ARGV);
>MakeLabel("Hello World!");
>ShowDisplay;
>MainLoop;
>
>it goes:
>Usage: Sx::OpenDisplay(args,...) at sxtest.pl line 4.
>
>and if I do
>#! /local/bin/perl5
>use Sx;
>
>OpenDisplay("My Window", @ARGV);
>MakeLabel("Hello World!");
>ShowDisplay;
>MainLoop;
>
>it goes "Segmentation fault", which is something that also happens if
>I try to run SxDemo.pl.
>
>I'm on a Digital UNIX osf1 V4 and my perl is 5.00404. I have tried
>both cc and gcc when compiling.
>
>Anybody got any ideas where I should start looking?
>--
>Vennlig Tiddeli-bom,
>
>Kjetil
>--
>Kjetil Kjernsmo
>Graduate astronomy-student                    Problems worthy of attack
>University of Oslo, Norway            Prove their worth by hitting back
>E-mail: kjetikj@astro.uio.no                                - Piet Hein
>Homepage <URL:http://www.astro.uio.no/~kjetikj/>
>Webmaster@skepsis.no




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

Date: Sat, 7 Nov 1998 16:49:47 -0000
From: "JAustin" <info_net@globalnet.co.uk>
Subject: Re: Web_store question
Message-Id: <721vcd$i59$1@newnews.global.net.uk>

Have you tried chmod 644?






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

Date: Sat, 07 Nov 1998 17:23:46 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Why single iterator over each hash?
Message-Id: <Pine.GSO.4.02A.9811070839560.21718-100000@user2.teleport.com>

On Sat, 7 Nov 1998, Daniel Stutzman wrote:

>   Question 1:  How can I nest keys or while/each loops of the same
> hash?

There's currently no terribly easy way to have two iterators at once, but
you could pull the list of keys and iterate over that. That's what I'd
probably do.

>   Question 2:  I'm troubled by the messy interaction between these two
> loops.  After all, the main loop and create_file() both work fine
> seperately.  But combined, they get in each other's way.
>   So what are the advantages for a single iterator for each hash?  Is
> this a feature?

Storing the iterator in the hash is just one way it could have been done.
It could be that the iterator would stick to the code, but that would
cause complications for closures and recursive code. The iterator could
have been kept on the stack, but that would be slower. Since it's fairly
rare to multiply-iterate over the same hash, it's not usually a problem.

But there's no reason, in principle, that pos() couldn't be overloaded to
work with hashes. That is, pos(%hash) would return the key which each() is
about to return, or undef if the iterator has reached the end of the hash.

More interestingly, pos() can be used as an lvalue. That is, it could
appear on the left side of an assignment. If you were to assign a valid
key to pos(%hash), that would set the iterator to that element, so that it
would become the next one to be returned. If you assigned undef, the
iterator would be moved to the "end". (What would happen if you assign a
key that's not in the hash? Depends upon the whim of whoever implements
this; I'd put the iterator at the end and issue a warning if warnings are
turned on.)

So, this would let you save and restore the iterator of any hash. You and
some other people would find that handy. So, why hasn't it been done yet?
Simply a lack of round tuits, that's all. If you put together a patch,
I'll gladly write up the docs! :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

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

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


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4173
**************************************

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