[6267] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 889 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 3 20:17:34 1997

Date: Mon, 3 Feb 97 17:00:21 -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           Mon, 3 Feb 1997     Volume: 7 Number: 889

Today's topics:
     Re: $SIG{__DIE__} and eval (Hugo van der Sanden)
     [help] matching multiple patterns (Scott C. Fritzinger)
     Announce: JavaOne(sm) Sun's 1997 Worldwide Java Develop <javaone@sbexpos.com>
     Re: dropping trailing zeroes when "write (FA).... (Mike Stok)
     Re: dropping trailing zeroes when "write (FA).... (Mike Stok)
     Re: Future release question (Bennett Todd)
     Re: Here document.. here... Good boy (Daniel DuBois)
     How do I update @INC so I can use my module? (Ming-Hwa Torng  - csc)
     Re: How do I update @INC so I can use my module? (Mike Stok)
     Re: How do I update @INC so I can use my module? (Website Construction Company)
     How to do this using perl? <sgrover@elizacorp.com>
     Re: How to do this using perl? <blintz@webpromote.com>
     Re: Multithreadin' <johnt@laplaza.org>
     NT4 & MISN & Perl 5.0=yikes! (Mark William Acosta)
     Perl / NT (The Crazy One)
     Perl5, PPC AIX 4.2, Crashing the machine (was Re: Perl5 (William M. Perry)
     Re: Perl5, PPC AIX 4.2, Crashing the machine (was Re: P (Jens-Uwe Mager)
     reg exps <susanmolero@adv.es>
     Re: reg exps (Kevin)
     Re: Shell "case" command in perl (Abigail)
     Sockets mixed with files (Mr. Paul Dembry)
     Re: space stripping <rootbeer@teleport.com>
     Wanted: perl telnet examples <nrjw@nor.chevron.com>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: 4 Feb 1997 00:31:04 GMT
From: hv@crypt.compulink.co.uk (Hugo van der Sanden)
Subject: Re: $SIG{__DIE__} and eval
Message-Id: <5d6008$3eb@zinc.compulink.co.uk>

Piotr Piatkowski (kompas@galaxy.uci.agh.edu.pl) wrote:
:If die handler is not installed, errors (like calling undefined 
:subroutine and so on) are fatal, but the very same errors inside of 
:eval are not. But if I install such handler, it is called in both 
:cases!
I had the same problem. After some discussion with the Porters, I
ended up with:

sub _evalling {
    my $i = 0;
    my $sub;
    while (defined($sub = (caller($i++))[3])) {
        return 1 if $sub =~ /^\(eval( \d+)?\)$/;
    }
    0;
}

$::SIG{'__DIE__'} = sub {
    &{$self->{callback}}(@_ ? @_ : $@) unless _evalling;
    die @_;
};

There is a flag internal to perl that knows whether we are evalling or
not, but it is not currently accessible within the language. This may
change in the future, in which case the _evalling sub above would
become a simple check of some magic variable.

Hope this helps,

Hugo van der Sanden


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

Date: 3 Feb 1997 21:31:06 GMT
From: scottf@scs.unr.edu (Scott C. Fritzinger)
Subject: [help] matching multiple patterns
Message-Id: <5d5leq$54v@lothar.scs.unr.edu>


hey there... i have a question regarding pattern matching...

i want to match a string for multiple words (patterns) and try to do it in
1 statement... 

like, how would i match $text  for the strings "%name" and "%info"...

something like :

	if (($text =~ /%name/) || ($text =~ /%info/)) {
		# blah blah blah
	}

but only using 1 statement... like:

	$text =~ /%name , %info/i   

i know the comma isnt how to separate them, but is there a way to compound
the first statement into something similar to the second?

thanx..=) .. if you could mail me the response, i'd be very thankful.. :)

						-scott


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

Date: Mon, 03 Feb 1997 15:24:16 -0800
From: JavaOne <javaone@sbexpos.com>
Subject: Announce: JavaOne(sm) Sun's 1997 Worldwide Java Developer Conference(sm)
Message-Id: <32F67372.585E@sbexpos.com>

JavaOne(sm) IS BACK!  

JavaOne will be held again this Spring - April 2-4, 1997 at San
Francisco's Moscone Center.  JavaOne is Sun's Official 1997 Worldwide
Java Developer Conference(sm) and the focus for this year remains the
same; this 3-day technical conference is the best opportunity for you to
learn about the new Java(tm) technologies and future direction for Java,
directly from the source.

Once again, you'll hear in-depth, technical information directly from
the creators of Java - James Gosling and Bill Joy - and from Sun's Java
development team and a host of industry leaders.  You will have time to
network with fellow Java developers to share tips and tricks, see the
latest Java products in the pavilion and experience the hands-on
development areas at the conference.

Watch the Conference web site for the latest conference news, including
information on conference tracks and sessions, which will be available
later in the month.

http://java.sun.com/javaone/

Register before February 15, 1997 and save up to $200:
	$995	Early Bird Rate (valid until 2/15/97)
	$1095	Advance Registration (valid 2/16/97 - 3/27/97)
	$1195	On-Site Registration

Space is limited, so register today.

What:		JavaOne Sun's 1997 Worldwide Developer Conference
Where:		Moscone Convention Center, San Francisco
When:		April 2-4, 1997
Register:	visit:  http://java.sun.com/javaone/
			call:   800-668-2741 (US) or 415-372-7077 (Int'l)


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

Date: 3 Feb 1997 21:51:46 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: dropping trailing zeroes when "write (FA)....
Message-Id: <5d5mli$90u@news-central.tiac.net>

In article <32F60DE3.538@gel.com>, John Ulmer  <jru@gel.com> wrote:
>I'm having trouble finding an easy way to write numeric
>values to a file and keeping the trailing zeroes needed for
>a correct number of significant figures.  The number of
>decimal places changes as the program moves from input
>record to the next input record.  Consequently, I can not
>use a set number of decimals.  My variable carries the
>correct number of significant figures until I try to write
>it.

You can try using sprintf to either make a formatted copy of the variable
and use the formatted variable in the format, or in perl 5 you can indulge
in a certain amount of chicanery:

#!/usr/local/bin/perl -w

for ($x = 0; $x < 5; $x += 1/3) {
  $xFmt = sprintf '%0.2f', $x;
  write;
}

format STDOUT =
@>>>>>>>>>>> @>>>>>>>>>>> @>>>>>>>>>>> @>>>>>>>>>>>
$x, $xFmt, @{[sprintf '%0.2f', $x]}, ${\sprintf '%0.2f', $x}.


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

Date: 3 Feb 1997 22:19:51 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: dropping trailing zeroes when "write (FA)....
Message-Id: <5d5oa7$b0r@news-central.tiac.net>

In article <5d5mli$90u@news-central.tiac.net>,
Mike Stok <mike@stok.co.uk> wrote:

>format STDOUT =
>@>>>>>>>>>>> @>>>>>>>>>>> @>>>>>>>>>>> @>>>>>>>>>>>
>$x, $xFmt, @{[sprintf '%0.2f', $x]}, ${\sprintf '%0.2f', $x}.
[snip...]

looks like that lone period surprised the news server, what I meant was
that this code (without the 2 leading spaces...)

  #!/usr/local/bin/perl -w

  for ($x = 0; $x < 5; $x += 1/3) {
    $xFmt = sprintf '%0.2f', $x;
    write;
  }

  format STDOUT =
  @>>>>>>>>>>> @>>>>>>>>>>> @>>>>>>>>>>> @>>>>>>>>>>>
  $x, $xFmt, @{[sprintf '%0.2f', $x]}, ${\sprintf '%0.2f', $x}
  .

  __END__

produces this output on my PC:

           0         0.00         0.00         0.00
0.3333333333         0.33         0.33         0.33
0.6666666666         0.67         0.67         0.67
           1         1.00         1.00         1.00
1.3333333333         1.33         1.33         1.33
1.6666666666         1.67         1.67         1.67
           2         2.00         2.00         2.00
2.3333333333         2.33         2.33         2.33
2.6666666666         2.67         2.67         2.67
           3         3.00         3.00         3.00
3.3333333333         3.33         3.33         3.33
3.6666666666         3.67         3.67         3.67
           4         4.00         4.00         4.00
4.3333333333         4.33         4.33         4.33
4.6666666666         4.67         4.67         4.67
           5         5.00         5.00         5.00

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Mon, 3 Feb 1997 21:44:34 GMT
From: bet@nospam.interactive.net (Bennett Todd)
Subject: Re: Future release question
Message-Id: <slrn5fcn22.k6n.bet@onyx.interactive.net>

On 3 Feb 1997 19:56:51 GMT, Tim Gallagher <tagallag@ichips.intel.com> wrote:
>Does anyone know the status of the perl compiler.

Which one?

>Currently only an interpreter is available.

That is not the case.

The main Perl implementation, currently at 5.003 patchlevel 24, is a
load-and-go compiler, and has been since the very beginning of the language.
Pure interpreters are pretty rare lately. In fact, the only one I would know
how to find is TCL.

So, since you think the current Perl is not a compiler, you presumably want
something that it doesn't offer you. What is it you want?

There's also another compiler, not load-and-go, under development now,
available in alpha. Inasmuch as links to it are prominent on both
<http://www.perl.org/> and <http://www.perl.com/>, I gotta assume that it
doesn't have whatever it is that you want, either.

Or perhaps you just didn't bother making even the most trivial attempt to
answer the question yourself before posting your question?

-Bennett


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

Date: Mon, 03 Feb 1997 21:35:28 GMT
From: dan@spyglass.com (Daniel DuBois)
Subject: Re: Here document.. here... Good boy
Message-Id: <3300590c.73828239@news.enteract.com>

On 3 Feb 1997 13:44:05 -0500, jlerner@panix.com (Joshua Lerner) wrote:
>The code you posted works fine for me.  Remember, 'EndOfHtml' must be the
>only thing on the line (if it is to act as the string terminator). Perhaps
>you have some trailing spaces...? 

Actually, I did check for trailing spaces.  I should have mentioned that
since I'm sure alot of newbies get that wrong and pester this group.

However, later I found out that there were ^M's ending each line of my file
(but I didn't find this out until I abandoned << and converted the
outputting to a long series of repetitive prints, oh well) and I think it's
safe to say that was the reason.  (The ^M was keeping my #!/usr/bin/perl
notation from working!)

I don't know why vi wasn't showing me the ^M's, it usually does, and
usually a quick :1,$s/^M$// cleans up those Windows transferred files.

Thanks for the replies everyone.

-----
Daniel DuBois, Traveling Coderman        www.spyglass.com/~ddubois


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

Date: 3 Feb 1997 20:51:43 GMT
From: torng@ux2.cso.uiuc.edu (Ming-Hwa Torng  - csc)
Subject: How do I update @INC so I can use my module?
Message-Id: <5d5j4v$hr4@vixen.cso.uiuc.edu>


I want to install my own module so I can do "use my_module" from the pm file 
in my local directory.

I suppose I have to update @INC (or %INC). How DO I do that?
I am using Solaris 2.5.

Many Thanks,
-Ming


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

Date: 3 Feb 1997 21:37:12 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How do I update @INC so I can use my module?
Message-Id: <5d5lq8$7vm@news-central.tiac.net>

In article <5d5j4v$hr4@vixen.cso.uiuc.edu>,
Ming-Hwa Torng  - csc <torng@ux2.cso.uiuc.edu> wrote:
>
>I want to install my own module so I can do "use my_module" from the pm file 
>in my local directory.
>
>I suppose I have to update @INC (or %INC). How DO I do that?
>I am using Solaris 2.5.

You can say

  use lib '/path/to/my/dir';

in your code and it will update your @INC appropriately.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Tue, 04 Feb 1997 00:13:01 GMT
From: websites@erols.com (Website Construction Company)
Subject: Re: How do I update @INC so I can use my module?
Message-Id: <32f67ed1.7140380@news.erols.com>

Or if you want to make sure that the module is used before anything
else with similar names of subroutines, you can "unshift" the
directory name to the @INC array.

Irwin
websites@medsites.com


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

Date: 3 Feb 1997 22:30:27 GMT
From: "Samir Grover" <sgrover@elizacorp.com>
Subject: How to do this using perl?
Message-Id: <01bc1222$4ccd9220$6b00000a@e15>

@data = split("\", "c:\speech\work");

I want to split "c:\speech\work" into array of "c:", "speech" and "work".

"\" is creating a problem for perl compiler.

Samir



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

Date: Mon, 03 Feb 1997 16:50:28 -0600
From: Brian Lintz <blintz@webpromote.com>
Subject: Re: How to do this using perl?
Message-Id: <32F66BB4.3E702C53@webpromote.com>

Samir Grover wrote:
> 
> @data = split("\", "c:\speech\work");
> 
> I want to split "c:\speech\work" into array of "c:", "speech" and "work".
> 
> "\" is creating a problem for perl compiler.

try this instead:

@data = split("/\\/", 'c:\speech\work');

the "\" is a special character that says 'the next character is somethin 
special' ... so if you want the actual '\' character, you have to lead
it
with a "\"   {i.e.  '\' = \\    '$' = \$ }

did that make sense?

Brian

--
Brian Lintz
WebPromote - http://www.webpromote.com/


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

Date: Mon, 3 Feb 1997 14:36:17 -0700
From: Ray Davis <johnt@laplaza.org>
To: "Nathan V. Patwardhan" <nvp@shore.net>
Subject: Re: Multithreadin'
Message-Id: <Pine.SGI.3.95.970203143402.10879B-100000@laplaza.org>

On 1 Feb 1997, Nathan V. Patwardhan wrote:

> What examples did you use?  From where?  Did you use the Perl 5 sockets
> modules?  Please include some code for us to look at - it would be
> extremely helpful.

I used the following library, is it possible that i'm just trying to use
some faulty code?  The prob is that I have no experience on creating
socket code, only using pre-existing code, so I have no idea what's going
on, although i have heard rumors that sockets don't want to work on irix?

Thanx,
Ray

#!/usr/local/bin/perl
package sock;

;# USAGE:
;# ======
;#
;# To open a connection to a socket:
;#
;#      $handle = &sock'open($hostname, $port) || die $!;
;#      # hostname & port can each be either a name or a number
;#
;# Read and write the same as with any other file handle:
;#
;#      print $handle "hello, socket\n";
;#      $response = <$handle>;
;#
;# To close cleanly:
;#
;#      &sock'close($handle);
;#
;# To close all open sockets, in case of an emergency exit:
;#
;#      &sock'close_all;
;#
;# AUTHOR:      David Noble (dnoble@ufo.jpl.nasa.gov)
;# DATE:        11 Feb 1993
;#
;# Modify and use as you see fit, but please leave my name on
;# it as long as it still resembles the original code.
;#
;#############################################################################

;# Get system-specific socket parameters, make assumptions if necessary.
$sockaddr_t = 'S n a4 x8';
eval "require 'sys/socket.ph'";
eval <<'END_SOCKET_DEFINITIONS' if $@;
  sub AF_INET           { 2; }
  sub SOCK_STREAM       { 1; }
  sub SOL_SOCKET        { 65535; }
  sub SO_REUSEADDR      { 4; }
END_SOCKET_DEFINITIONS

;# Seed the generation of names for file handles.
$latest_handle = 'sock0000000001';

sub open {
  local ($remote_host, $remote_port) = @_;
  if (!$remote_port) {
    $! = "bad arguments to sock'open()";
    return 0;
  }
  $sock = ++$latest_handle;

  ;# Look up the port if it was specified by name instead of by number.
  if ($remote_port =~ /\D/o) {
    ($name,$aliases,$remote_port) = getservbyname($remote_port,'tcp');
  }

  ;# Look up the address if it was specified by name instead of by number.
  if ($remote_host =~ /\D/o) {
    ($name,$aliases,$type,$len,$remote_addr) = gethostbyname($remote_host);
  } else {
    $remote_addr = $remote_host;
  }

  ;# Make the socket structures.
  $this = pack($sockaddr_t, &AF_INET, 0, "\0\0\0\0");
  $remote_sock = pack($sockaddr_t, &AF_INET, $remote_port, $remote_addr);

  ;# Make the socket filehandle.
  ($name,$aliases,$proto) = getprotobyname('tcp');
  socket($sock, &AF_INET, &SOCK_STREAM, $proto) || return 0;

  ;# Set up the port so it's freed as soon as we're done.
  setsockopt($sock, &SOL_SOCKET, &SO_REUSEADDR, 1);

  ;# Bind this socket to an address.
  bind($sock, $this) || return 0;

  ;# Call up the remote socket.
  connect($sock,$remote_sock) || return 0;

  $handles{$sock} = 1;
  $oldfh = select($sock); $| = 1; select($oldfh);
  return "sock'" . $sock;
}

sub close {
  local ($sock) = shift(@_) || return 0;
  shutdown ($sock, 2);
  delete $handles{$sock};
}

sub close_all {
  for $sock (keys %handles) {
    shutdown ($sock, 2);
    delete $handles{$sock};
  }
}
1;




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

Date: 3 Feb 1997 22:43:44 GMT
From: mwa@Hawaii.Edu (Mark William Acosta)
Subject: NT4 & MISN & Perl 5.0=yikes!
Message-Id: <5d5pn0$sa6@news.Hawaii.Edu>

When I run my perl scripts using Netscape the Microsofte INternet Server 
sends the content type back has x-perl instead of text\plain or 
text\html. When I run the same script using MS Internet Explorer it runs
fine? What gives? How do I tell the Microsoft INternet Server to send
the right content type so my perl code can be useful.
	Thanks,
			Mark 


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

Date: Mon, 03 Feb 1997 21:23:12 GMT
From: ian@mad.scientist.com (The Crazy One)
Subject: Perl / NT
Message-Id: <32f6565c.308523@news.demon.co.uk>

Hello,

I'm new to Perl and am trying to use it on my Intranet site.

Does anyone out there have experience of Perl on NT, especially with
Majordomo or Excite Search Engine ?

If anyone can offer any help with Perl on the Windows NT Platform, it
would be gratefully received.

Please reply either to this newsgroup, or directly to me.

Thanks.

Ian Offers


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

Date: 03 Feb 1997 11:51:35 -0800
From: wmperry@aventail.com (William M. Perry)
Subject: Perl5, PPC AIX 4.2, Crashing the machine (was Re: Perl5.003 and AIX)
Message-Id: <863evdllbs.fsf_-_@kramer.in.aventail.com>

jum@anubis.han.de (Jens-Uwe Mager) writes:

> In article <01bc0d47$31f10750$3d1b6e87@chyatt>, "chyatt"
> <chyatt@acxiom.com> wrote:
> 
> > Has anyone successfully configured Perl 5.003 on AIX 4.2?  I took all the
> > defaults, but it won't make.  Any ideas? 
> 
> Did you try using IBM's C Compiler? There have been several reports from
> people having difficulty getting it compiled using gcc.

  I've been having some truly psychotic problems under AIX 4.2 on a PPC 604
machine here.  Can you successfully use loadable modules?  I can run some
standard things (socket, etc), but a module I have written in house craps
out and dies.  Basically, this module provides a layer for getting at other
 .so files that conform to certain restrictions:

1) Each module provides a foo_identify function (where foo varies)
2) This function returns a (ModuleInfo *), which is just a structure that
   contains pointers to other functions, and various forms of descriptive
   text (strictly 'char *')

  This module works fine under every other OS I have run it on (Linux,
HP/UX, BSDI, Solaris (x86 & Sparc), SunOS, IRIX 6.x, SCO OpenServer 5,
and UnixWare.  However, under AIX it causes truly horrible things to
happen when the application exits.  The machine completely crashes (no
telnet, no terminal login, nothing).  Requires a reboot (if it doesn't kick
in automatically).

  You do not even have to _use_ the module for it to crash.  Simply doing:
perl -e 'push(@INC,"./"); use Aventail::SharedLibs; exit;'
will cause the crash.  It works flawlessly up to the point of exiting.  I
can correctly retrieve any information out of the ModuleInfo structure that
I want and pass it back up to the perl program.

  The only thing I notice is that dl_aix.xs uses a truly bizarre method of
opening libraries, even though AIX 4.x does have dlopen() and friends.
Aventail::SharedLibs does use dlopen() - could there be subtle interactions
between the two methods?  I tried telling perl to use
ext/DynaLoader/dl_dlopen.xs instead of dl_aix.xs, but no luck - segfaults
as soon as it tries to call boot_FOO, for any module FOO.

  I tried running the gauntlet of IBM support, but their response was
'Sorry, we don't support PERL'.  Annoying.  you'd think they would be
interested in a user-space program that can cause the machine to completely
die like this.

-Bill P.
-- 
William Perry			wmperry@aventail.com
Unix Server Development Lead  & Emacs-W3 Author
Aventail, Corp.			http://www.aventail.com


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

Date: Mon, 3 Feb 1997 23:51:36 GMT
From: jum@anubis.han.de (Jens-Uwe Mager)
Subject: Re: Perl5, PPC AIX 4.2, Crashing the machine (was Re: Perl5.003 and AIX)
Message-Id: <jum-ya02408000R0402970051360001@baghira.han.de>

In article <863evdllbs.fsf_-_@kramer.in.aventail.com>, wmperry@aventail.com
wrote:

> jum@anubis.han.de (Jens-Uwe Mager) writes:
> 
> > In article <01bc0d47$31f10750$3d1b6e87@chyatt>, "chyatt"
> > <chyatt@acxiom.com> wrote:
> > 
> > > Has anyone successfully configured Perl 5.003 on AIX 4.2?  I took all the
> > > defaults, but it won't make.  Any ideas? 
> > 
> > Did you try using IBM's C Compiler? There have been several reports from
> > people having difficulty getting it compiled using gcc.
> 
>   I've been having some truly psychotic problems under AIX 4.2 on a PPC 604
> machine here.  Can you successfully use loadable modules?  I can run some
> standard things (socket, etc), but a module I have written in house craps
> out and dies.  Basically, this module provides a layer for getting at other
> .so files that conform to certain restrictions:
> 
> 1) Each module provides a foo_identify function (where foo varies)
> 2) This function returns a (ModuleInfo *), which is just a structure that
>    contains pointers to other functions, and various forms of descriptive
>    text (strictly 'char *')
> 
>   This module works fine under every other OS I have run it on (Linux,
> HP/UX, BSDI, Solaris (x86 & Sparc), SunOS, IRIX 6.x, SCO OpenServer 5,
> and UnixWare.  However, under AIX it causes truly horrible things to
> happen when the application exits.  The machine completely crashes (no
> telnet, no terminal login, nothing).  Requires a reboot (if it doesn't kick
> in automatically).
> 
>   You do not even have to _use_ the module for it to crash.  Simply doing:
> perl -e 'push(@INC,"./"); use Aventail::SharedLibs; exit;'
> will cause the crash.  It works flawlessly up to the point of exiting.  I
> can correctly retrieve any information out of the ModuleInfo structure that
> I want and pass it back up to the perl program.
> 
>   The only thing I notice is that dl_aix.xs uses a truly bizarre method of
> opening libraries, even though AIX 4.x does have dlopen() and friends.
> Aventail::SharedLibs does use dlopen() - could there be subtle interactions
> between the two methods?  I tried telling perl to use
> ext/DynaLoader/dl_dlopen.xs instead of dl_aix.xs, but no luck - segfaults
> as soon as it tries to call boot_FOO, for any module FOO.
> 
>   I tried running the gauntlet of IBM support, but their response was
> 'Sorry, we don't support PERL'.  Annoying.  you'd think they would be
> interested in a user-space program that can cause the machine to completely
> die like this.

If your machine crashes using a user level program, that is definitely a
reason for IBM to fix their operting system, without regard which user
level program did cause the crash.

I have been using a similar scheme of modules like you do for quite a
while, and this works fine even under AIX 4.2. But I have to confess that I
still build under AIX 3, as this is the method to get the binaries to run
on any AIX version. This is also the reason Perl uses the "bizarre" method
to load modules, this works on any AIX version, not only 4.2.
_______________________________________________________________________
Jens-Uwe Mager                  jum@anubis.han.de
30177 Hannover                  jum@helios.de
Brahmsstr. 3                    Tel.: +49 511 660238


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

Date: 3 Feb 1997 21:59:16 GMT
From: "Susan Molero" <susanmolero@adv.es>
Subject: reg exps
Message-Id: <01bc121c$cfc045c0$LocalHost@mihost.adv>


Hello,
I'm working with perl and have a problem with two bits
of code. I think the problem is with the regular 
expressions I'm using, but I'm not sure.
If anyone can easily spot the problem, I'd really
appreciate a hand.

I have a file called doc, with the following data: 

hjshjsdhchjdh   bbvffgvrf
TI:   This is field TI
PD: This is pd    
TX:jhsdhjd   
   1. Field one.
   2. Field two.
OA:  Field OA


The following code tries to get the value of fields
TI and PD. It gets correctly TI, but doesn4t go ever
into the second 'if'.

-------------------------
$file="doc";
open(myfile,"$file")||die "Couldn't open $file:$!\n";

@array=<myfile>;

$_="@array";

s/\n/ /g;  # substitute newlines by whites

if (/TI:(.*) $1PD/) {   # $1 should contain everything 
                        # between TI: and PD, i.e. the 
                        # value of field TI.
 print "\nTI:$1\n\n";
}
if (/PD:(.*) $1TX/) { #try the same for PD as for TI before
                      #but this time doesn't go inside
                      #this 'if' 
 print "\nPD:$1\n\n";
}

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


The following should print subfield '1.' of field TX:


if (/TX:(.*) $1 OA/) { # get in $1 the whole field TX.
                       # up to here, it works as expected 
 if ($1=~/1.(.*) $2 2/) {  # get everything between 1.
                           # and 2., i.e., field 1, and
                           # store it in $2. 
  print "\n2.:$2\n\n";
 }
}


But, $2 seems to be empty, instead of having stored the string 'Field 1.'

Any idea ?
Thank you very much for reading this message.
Susan





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

Date: Mon, 03 Feb 1997 23:59:51 GMT
From: klander@primenet.com (Kevin)
Subject: Re: reg exps
Message-Id: <32f67ba2.30130074@news.genuity.com>

Remember, on 3 Feb 1997 21:59:16 GMT,  in comp.lang.perl.misc, you
wrote:

>if (/TI:(.*) $1PD/) {   # $1 should contain everything 
>                        # between TI: and PD, i.e. the 
>                        # value of field TI.
> print "\nTI:$1\n\n";
>}
>if (/PD:(.*) $1TX/) { #try the same for PD as for TI before
>                      #but this time doesn't go inside
>                      #this 'if' 
> print "\nPD:$1\n\n";
>}

The problem is that you have $1 in the regular expressions.  I'm not
real sure why you're doing this, but that is what's messing you up.
For the first 'if', $1 is undefined, so the regex is really just:
/TI:(.*) PD/

but, for the second if, $1 is now "   This is field TI ", so your
regex becomes:
/PD:(.*)    This is field TI  TX/

hence, no match there.  Take the $1's out of the regexps.

>if (/TX:(.*) $1 OA/) { # get in $1 the whole field TX.
>                       # up to here, it works as expected 
> if ($1=~/1.(.*) $2 2/) {  # get everything between 1.
>                           # and 2., i.e., field 1, and
>                           # store it in $2. 

I think I see the problem here.  You don't quite understand how the
$1's work.  When you perform a match, whether in a substitution, or
just regexp match, and you enclose part of the regexp in parentheses,
the $n variables get assigned whatever matched the regexp between the
parentheses.  The first set of parentheses gets $1, the second set
gets $2, and so on.  This happens for each and every regexp, so you
can't do this: $1=~/1.(.*) 2/.  $1 will be assigned whatever matches
the '.*'.  Get it?

<emailed and posted>

--
   Kevin - klander@primenet.com
           http://www.primenet.com/~klander

--


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

Date: Mon, 3 Feb 1997 20:53:12 GMT
From: abigail@ny.fnx.com (Abigail)
Subject: Re: Shell "case" command in perl
Message-Id: <E51ooo.4AC@nonexistent.com>

On 3 Feb 1997 11:55:00 GMT, Jan-Patrick Perisse Sys. Admin wrote in comp.lang.perl.misc:
++ How would a bash "case" look like in perl?
++  I've been reading the book and found nothing about it.


I prefer to use:


foreach ($test) {
    /foo/     and do {something; last;};
    /bar/     and do {some other thing; last;};
    /nut/     and do {bla bla; last;};
    default things to do;
}


You find more examples on pages 104 and 105 of the book [*].


Abigail

[*] The book is (of course):
    [WaChSc 96a] 
       Larry Wall, Tom Christiansen and Randal L. Schwartz with Stephen Potter:
       Programming Perl. Sebastopol: O'Reilly & Associates, Inc., 1996.
       [ISBN 1-56592-149-6] 



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

Date: 3 Feb 1997 22:16:32 GMT
From: VARD96A@prodigy.com (Mr. Paul Dembry)
Subject: Sockets mixed with files
Message-Id: <5d5o40$hlg@usenetp1.news.prodigy.com>

I am running into a strange problem when I combine sockets and 
"regular" files.  As soon as I've done any file operation, such as   
  open(MYHANDLE,"/tmp/xyz");
my subsequent socket connect() call hangs because it is not getting to 
the server (I have logging in the server after the accept call).  Has 
anyone ever seen the same behavior and how do I get around it?
Thanks,
Paul
pade@trifox.com


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

Date: Mon, 3 Feb 1997 13:02:20 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dennis Marti <marti@netrail.net>
Subject: Re: space stripping
Message-Id: <Pine.GSO.3.95.970203130113.73M-100000@linda.teleport.com>

On 2 Feb 1997, Dennis Marti wrote:

> : 		s/#.*//; # kill comments

> Doesn't this mess you up when you have lines like this?
> 
>     s/#.*//; # kill comments

This is code for processing a file in a termcap-like format, so there
wouldn't be any code in it. 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Mon, 3 Feb 1997 16:32:20 -0600
From: "Randall J. Wormser" <nrjw@nor.chevron.com>
Subject: Wanted: perl telnet examples
Message-Id: <Pine.ULT.3.94.970203162709.29296J-100000@grus07.nor.chevron.com>

Does anyone out there have an example which uses perl to run a telnet
session?  The Perl FAQ indicates that such an example resides at
ftp.cis.ufl.edu:/pub/perl/scripts/getduatweather.pl, but I can't find it
there or anywhere else.  A direct reply would be most appreciated.

Thanks.

Randall J. Wormser
Chevron Information Technology Co.     Phone ....... (504) 592-6279
935 Gravier Street                     FAX ......... (504) 592-7106
New Orleans, LA  70112                 E-Mail .... nrjw@chevron.com



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

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

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 V7 Issue 889
*************************************

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