[24983] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7233 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 12 14:07:07 2004

Date: Tue, 12 Oct 2004 11:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 12 Oct 2004     Volume: 10 Number: 7233

Today's topics:
    Re: a problem with variable interpolation.. <toreau@gmail.com>
        Acceptible idiom ? <koos@no.spam>
    Re: Acceptible idiom ? (Anno Siegel)
    Re: Acceptible idiom ? <notvalid@email.com>
    Re: Acceptible idiom ? <sdn.girths00869@zoemail.net>
    Re: Acceptible idiom ? <koos@no.spam>
    Re: Acceptible idiom ? <koos@no.spam>
    Re: Accessing hashes and converting into an array <ebohlman@omsdev.com>
    Re: Accessing hashes and converting into an array (Rohit S)
    Re: Accessing hashes and converting into an array <tadmc@augustmail.com>
    Re: Accessing hashes and converting into an array <tadmc@augustmail.com>
    Re: Accessing hashes and converting into an array <tadmc@augustmail.com>
    Re: Accessing hashes and converting into an array <jurgenex@hotmail.com>
    Re: automatically closing Msgbox <josef.moellers@fujitsu-siemens.com>
        building anonymous arrays and adding reference to main  (wana)
    Re: building anonymous arrays and adding reference to m <nobull@mail.com>
    Re: building anonymous arrays and adding reference to m (Anno Siegel)
    Re: conditional help <Joe.Smith@inwap.com>
    Re: deleting data from a text file <jurgenex@hotmail.com>
    Re: Error.pm and DBI.pm problem (Peter Scott)
        function overload (not operator overload) <ijliao@csie.nctu.edu.tw>
    Re: function overload (not operator overload) (Anno Siegel)
    Re: Getopt::Long install problems <Joe.Smith@inwap.com>
        Has anyone ported Trek-80 to Perl? (David Filmer)
    Re: Has anyone ported Trek-80 to Perl? <justme@fakedomain.net>
    Re: Has anyone ported Trek-80 to Perl? (Randal L. Schwartz)
    Re: how do i automatically close a Msgbox based on a ti <MrReallyVeryNice.REMOVE.NO.SPAM@Yahoo.REMOVE.NO.SPAM.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 11 Oct 2004 10:32:01 +0200
From: Tore Aursand <toreau@gmail.com>
Subject: Re: a problem with variable interpolation..
Message-Id: <pan.2004.10.11.08.32.01.549012@gmail.com>

On Sun, 10 Oct 2004 23:13:35 -0700, Kevin wrote:
> #!/opt/perl_5.8.5/bin

Remember these:

  use strict;
  use warnings;

> $var1 = 'foo';
> $var2 = 'bar';
> $var3 = 'huh';
> 
> $sentence = "\dhdu\$var1\sdjadf\$var2\edjd\$var3";

The '\' will escape anything that comes right after it.  You probably want
to escape the '\' character itself, or use the '/' character instead
(which works just fine on multiple platforms).


-- 
Tore Aursand <toreau@gmail.com>
"When you love someone, all your saved-up wishes start coming out."
 (Elizabeth Bowen)


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

Date: Mon, 11 Oct 2004 11:36:54 +0200
From: Koos Pol <koos@no.spam>
Subject: Acceptible idiom ?
Message-Id: <newscache$tmye5i$yw$1@news.emea.compuware.com>


Although you need to actively think Perl,

  !!$a

is a lot shorter than

  defined $a && ($a ne "" || $a <>0 );

Comments?
-- 
KP
43rd Law of Computing: "Anything that can go wr
fortune: Segmentation violation -- Core dumped


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

Date: 11 Oct 2004 09:44:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Acceptible idiom ?
Message-Id: <ckdkmm$fao$3@mamenchi.zrz.TU-Berlin.DE>

Koos Pol  <koos@no.spam> wrote in comp.lang.perl.misc:
> 
> Although you need to actively think Perl,
> 
>   !!$a
> 
> is a lot shorter than
> 
>   defined $a && ($a ne "" || $a <>0 );
> 
> Comments?

That's a quite common idiom for normalizing booleans, not only in Perl.
It is useful in all languages that take a similar approach to booleans:
Everything is true except for a (small) number of exceptions that are
false.

I have called the construct "Das doppelte Notchen", but it takes a
native German speaker to estimate the full inanity of that pun.

Anno


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

Date: Tue, 12 Oct 2004 16:37:00 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Acceptible idiom ?
Message-Id: <MKTad.2535$6q2.2318@newssvr14.news.prodigy.com>

Koos Pol wrote:

> And that is exactly what I was after. !! makes is possible to
> check for true even with undefined variables.

Undefined variables can never be true. Your code simply reduces to:

	if ($a) { ... }

but, I have a feeling you already knew that :)

--Ala


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

Date: Mon, 11 Oct 2004 20:36:23 -0500
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: Acceptible idiom ?
Message-Id: <Xns957FDBFB3E1E8sdn.comcast@216.196.97.136>

Koos Pol <koos@no.spam> wrote in news:newscache$tmye5i$yw$1
@news.emea.compuware.com:

> 
> Although you need to actively think Perl,
> 
>   !!$a
> 
> is a lot shorter than
> 
>   defined $a && ($a ne "" || $a <>0 );
> 
> Comments?

First and foremost, the above is a syntax error.  But let's suppose you 
really meant "$a != 0" up there.

If $a is 0, then !!$a is '', but defined $a && ($a ne "" || $a != 0) is 1.
So !!$a may be shorter, but it is not equivalent.

-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

Date: Tue, 12 Oct 2004 08:21:08 +0200
From: Koos Pol <koos@no.spam>
Subject: Re: Acceptible idiom ?
Message-Id: <newscache$g8kg5i$dc1$1@news.emea.compuware.com>

Randal L. Schwartz wrote (Monday 11 October 2004 16:25):

> Koos: replacing (defined $a && ($a != "")) with (!!$a)

> There is no promise that !! returns a value of "1" for true.
> Caveat executor.

That alright. Just interested in true/false and getting rid of
that ubiquitous dreadful test.

Koos
-- 
KP
43rd Law of Computing: "Anything that can go wr
fortune: Segmentation violation -- Core dumped


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

Date: Tue, 12 Oct 2004 08:28:28 +0200
From: Koos Pol <koos@no.spam>
Subject: Re: Acceptible idiom ?
Message-Id: <newscache$nkkg5i$gc1$1@news.emea.compuware.com>

Abigail wrote (Monday 11 October 2004 23:06):

> \\   !!$a
> \\
> \\  is a lot shorter than
> \\
> \\    defined $a && ($a ne "" || $a <>0 );

> Yes, but what is your point?
> 
>     defined $a && ($a ne "" || $a <>0 );
> 
> is a syntax error,

Yes. I was typing faster then thinking. My bad.

> and if you mean '!=' where you write '<>', 
> the expressions are not equivalent. '($a ne "" || $a != 0)' is
> only false if $a is some overloaded object that is the empty
> string in string context, and 0 is numeric context. So, assuming
> that $a isn't such an object...

Assume I'm maintainig a script which misuses a var to have both
string and numeric values... :-(

> But 'defined $a' is true for '$a == 0', but for '$a == 0',
> '!!$a' is false.

And that is exactly what I was after. !! makes is possible to
check for true even with undefined variables.

Koos
-- 
KP
43rd Law of Computing: "Anything that can go wr
fortune: Segmentation violation -- Core dumped


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

Date: 12 Oct 2004 02:29:47 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <Xns957FDB848CC02ebohlmanomsdevcom@130.133.1.4>

Tad McClellan <tadmc@augustmail.com> wrote in 
news:slrncmlb6i.pi0.tadmc@magna.augustmail.com:

> Rohit S <rohit.satabhai@bt.com> wrote:
> 
>> use HTML;
> 
>> use template
>              ^^
>              ^^  where is the semicolon?
>> use Datetime;
> 
> 
> Looks like we are not looking that the same code that you
> are looking at, since our's will not even compile, and it
> sounds like your's is executing...

Which is so bad that it made Tad forget how to use apostrophe's :-)


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

Date: 12 Oct 2004 05:08:25 -0700
From: rohit.satabhai@bt.com (Rohit S)
Subject: Re: Accessing hashes and converting into an array
Message-Id: <2bbc95a4.0410120408.5dc443da@posting.google.com>

Ok Let me put this way
How do I print the following

ora_data[0]{'STUDENT' => joe,
            'SUBJECT' => { 'M' => 78,
                                'SC' => 80
                               }
                 }

ora_data[1]{'STUDENT' => phil,
            'SUBJECT' => { 'M' => 84,
                                'GE' => 89
                               }
                 }

ora_data[2]{'STUDENT' => steve,
            'SUBJECT' => { 'SC' => 84,
                                'GE' => 89,
                                'ENG' => 95
                               }
                 }
------------------------------------------------------------


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

Date: Tue, 12 Oct 2004 08:09:05 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <slrncmnlrh.t7p.tadmc@magna.augustmail.com>

Rohit S <rohit.satabhai@bt.com> wrote:

> How do I print the following
> 
> ora_data[0]{'STUDENT' => joe,
>             'SUBJECT' => { 'M' => 78,
>                                 'SC' => 80
>                                }
>                  }
> 
> ora_data[1]{'STUDENT' => phil,
>             'SUBJECT' => { 'M' => 84,
>                                 'GE' => 89
>                                }
>                  }
> 
> ora_data[2]{'STUDENT' => steve,
>             'SUBJECT' => { 'SC' => 84,
>                                 'GE' => 89,
>                                 'ENG' => 95
>                                }
>                  }


------------------------
use Data::Dumper;
 ...
print Dumper \@ora_data;
------------------------



-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 12 Oct 2004 08:11:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <slrncmnlvj.t7p.tadmc@magna.augustmail.com>

Rohit S <rohit.satabhai@bt.com> wrote:

> How do I print the following
> 
> ora_data[0]{'STUDENT' => joe,
>             'SUBJECT' => { 'M' => 78,
>                                 'SC' => 80
>                                }
>                  }


   print "$ora_data[0]{STUDENT}\n";      # prints "joe"
   print "$ora_data[0]{SUBJECT}{SC}\n";  # prints "80"


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 12 Oct 2004 08:07:54 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <slrncmnlpa.t7p.tadmc@magna.augustmail.com>

Rohit S <rohit.satabhai@bt.com> wrote:

> How do I print the following
> 
> ora_data[0]{'STUDENT' => joe,
>             'SUBJECT' => { 'M' => 78,
>                                 'SC' => 80
>                                }
>                  }
> 
> ora_data[1]{'STUDENT' => phil,
>             'SUBJECT' => { 'M' => 84,
>                                 'GE' => 89
>                                }
>                  }
> 
> ora_data[2]{'STUDENT' => steve,
>             'SUBJECT' => { 'SC' => 84,
>                                 'GE' => 89,
>                                 'ENG' => 95
>                                }
>                  }


Easy!


----------------------
#!/usr/bin/perl
use warnings;
use strict;

print <<ENDSTUFF;
ora_data[0]{'STUDENT' => joe,
            'SUBJECT' => { 'M' => 78,
                                'SC' => 80
                               }
                 }

ora_data[1]{'STUDENT' => phil,
            'SUBJECT' => { 'M' => 84,
                                'GE' => 89
                               }
                 }

ora_data[2]{'STUDENT' => steve,
            'SUBJECT' => { 'SC' => 84,
                                'GE' => 89,
                                'ENG' => 95
                               }
                 }
ENDSTUFF
----------------------


The quality of the answer is often directly proportional to the
care taken in composing the question.

Have you seent the Posting Guidelines that are posted here frequently?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 12 Oct 2004 13:46:20 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <MeRad.3863$Rp4.2736@trnddc01>

Rohit S wrote:
> Ok Let me put this way
> How do I print the following
>
> ora_data[0]{'STUDENT' => joe,
>            'SUBJECT' => { 'M' => 78,
>                                'SC' => 80
>                               }
> [...]

I'd use Data::Dumper

jue 




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

Date: Tue, 12 Oct 2004 08:52:21 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: automatically closing Msgbox
Message-Id: <ckfuqp$4rd$1@nntp.fujitsu-siemens.com>

Darc wrote:
> anyone know how to set a Msgbox that automatically closes after a set p=
eriod
> of time?

Anyone know why either your name has changed from Dwayne Kuan to Darc or =

why you take part in a thread about the very same subject yet post this=20
new article?

I'm tempted to ignore you.
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: 12 Oct 2004 04:58:47 -0700
From: ioneabu@yahoo.com (wana)
Subject: building anonymous arrays and adding reference to main array
Message-Id: <bf0b47ca.0410120358.5bbac5f0@posting.google.com>

suppose you have this:

@array1 = ();
@array2 = ();
@array3 = ();
$count = 0;
foreach(@array1)
{
	if (count % 100 == 0)
	{
		#the code in question:
		push @array3, \@array2;
		@array2 = ();	
	}
	push @array2, $_;
	count++;
}

I don't think this will work as expected because what I really want is
to create an anonymous array from @array2 and push a reference to that
onto @array3.

Or at least I think that's the way to do it but I'm not sure how to
create an anonymous array from the contents of another array.

Thanks!

wana


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

Date: Tue, 12 Oct 2004 17:49:53 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: building anonymous arrays and adding reference to main array
Message-Id: <ckh1n1$57l$1@sun3.bham.ac.uk>



wana wrote:

> suppose you have this:
> 
> @array1 = ();
> @array2 = ();
> @array3 = ();
> $count = 0;
> foreach(@array1)
> {
> 	if (count % 100 == 0)
> 	{
> 		#the code in question:
> 		push @array3, \@array2;
> 		@array2 = ();	
> 	}
> 	push @array2, $_;
> 	count++;
> }

Since @array1 is known empty your whole problem optomizes away completely.

I shall assume instead that @array1 should contain several hundred elements.

> I don't think this will work as expected because what I really want is
> to create an anonymous array from @array2 and push a reference to that
> onto @array3.
> 
> Or at least I think that's the way to do it but I'm not sure how to
> create an anonymous array from the contents of another array.

I'm curious how you come to know the term "anonymous array" and yet 
don't know how to create one.  Where did you come upon this term?

There are three ways to create an anonymous array:

   1) create a nonymous one and let its name drop out of scope
   2) use the explicit anonymous array constructor [ LIST ]
   3) use an undefined lvalue in an arrayref context (autovivification)

Anyhow your orginial problem is much more simply done...

my @array3;
{
    my @array2 = @array1;
    push @array3, [ splice @array2, 0, 100 ] while @array2;
}

Of course if you don't need to preserve @array1 then you can consume it 
directly and do away with @array2.

If you look at previous threads asking substancially the same question 
you'll see many other solutions using slices and map() but I think the 
one using splice and while is the most elegant.



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

Date: 12 Oct 2004 12:09:11 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: building anonymous arrays and adding reference to main array
Message-Id: <ckghh7$gi8$1@mamenchi.zrz.TU-Berlin.DE>

wana <ioneabu@yahoo.com> wrote in comp.lang.perl.misc:
> suppose you have this:
> 
> @array1 = ();
> @array2 = ();
> @array3 = ();
> $count = 0;
> foreach(@array1)
> {
> 	if (count % 100 == 0)
> 	{
> 		#the code in question:
> 		push @array3, \@array2;
> 		@array2 = ();	
> 	}
> 	push @array2, $_;
> 	count++;
> }
> 
> I don't think this will work as expected because what I really want is

Oh man...  So what do you expect?  How are we supposed to know when
all you present is code that *doesn't* do what you want?

> to create an anonymous array from @array2 and push a reference to that
> onto @array3.
> 
> Or at least I think that's the way to do it but I'm not sure how to
> create an anonymous array from the contents of another array.

Maybe you need "[@array2]" instead of "\@array2".  There's no way
of telling.

Anno


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

Date: Mon, 11 Oct 2004 07:33:10 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: conditional help
Message-Id: <WGqad.105335$He1.81774@attbi_s01>

Abigail wrote:

> Joe Smith (Joe.Smith@inwap.com) wrote on MMMMLI September MCMXCIII in
> <URL:news:I4_7d.197410$3l3.79898@attbi_s03>:
> ::  buildmorelines wrote:
> ::  
> :: > and this doesnt and generates syntax error?
> :: > 
> :: > #!/usr/bin/perl
> :: > print "true" if $ARGV[0];
> :: > else print "false";
> ::  
> ::  Because perl is not C.
> ::  
> ::     if() {...} elsif() {...} elsif() {...} else {...};
> ::  
> ::  The else part in perl is surrounded by braces.
> 
> 
> But 
> 
>     print "true" if $ARGV [0];
>     else {print "false"}
> 
> is a syntax either. It has nothing at all to do with "an else part
> needs to be surrounded by braces".

The point I was making is that when 'else' is not preceded by a '}',
it is a syntax error.  Of course the '}' has to be preceded by a '{'
and conditional test to be a complete statement.

You're right about the statement-modifier part; I should have
phrased that differently.
	-Joe


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

Date: Tue, 12 Oct 2004 02:17:03 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: deleting data from a text file
Message-Id: <z8Had.4128$y77.3787@trnddc05>

Shaf wrote:
> I am new to Perl and have a question regarding deleting header data
> from a text file.  I have a set of files that I need to delete data
> from.  Is there something in Perl to delete string data?  What is the
> best way for me to handle this?

This _Q_uestion is _A_sked _F_requently, please check "perldoc -q delete":

      "How do I change one line in a file/delete a line in a file/insert a 
line in the middle of a file/append to the beginning of a file?"

jue 




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

Date: Tue, 12 Oct 2004 14:38:16 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: Error.pm and DBI.pm problem
Message-Id: <s%Rad.702180$M95.264393@pd7tw1no>

In article <53867fbe.0410110738.6976f45a@posting.google.com>,
 unkwb@web.de (Horst Walter) writes:
>Here is a complete one you can run. I read all I found about error.pm,
>I am only not certain whether I have to include other use statements
>like qw(:catch).

No, you don't.

>Error is still 
>Error: Can't call method "with" without a package or object reference

I ran the below with changes for db account and got the expected
"Illegal division by zero at..."

You have to set ORACLE_HOME, but presumably you do that outside
the script.

I tried Perl 5.6.1 and 5.004 with the same results.

All I can think is that you have a bad DBI.pm, bad DBD::Oracle.pm,
or bad Error.pm.  Try creating a brand new perl on a different
computer altogether, installing the latest versions of those
modules, and point your script back at your Oracle server.

>use strict;
>use warnings;
>use Error qw(:try);
>use DBI;
>
># global 
>
>my $db = "XXXX";
>my $password = "XXXXX";
>my $username = "XXXXX";
>my $oracle_sid = $db;
>my $dbh;
>
>try {
>
>	unless ( $dbh = DBI->connect("dbi:Oracle:$oracle_sid", "$username",
>$password, {AutoCommit => 0}) ) {
>		print STDERR ("autodb::oracleLogin login Failed as
>$username\/$password\@$oracle_sid");
>	}
>	unless ($dbh->disconnect) {
>		print STDERR "autodb::oracleLogoff $DBI::errstr";
>	}
>	# force an error
>	my $n = 0;
>	print 0/$n;
>} catch Error with {
>	my $err = shift;
>	print $err;
>}

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/


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

Date: Mon, 11 Oct 2004 07:26:02 +0000 (UTC)
From: Ying-Chieh Liao <ijliao@csie.nctu.edu.tw>
Subject: function overload (not operator overload)
Message-Id: <ckdcia$22on$1@netnews2.csie.nctu.edu.tw>

Can I do function overload in Perl (not operator) ?
I'd like to create a function, which accepts an object array or an
object iterator as argument ...

I've googled "perl function overload", but all I get is about operator
overload... what can I do in my case ? (except calling them by 
func_array(@array) and func_iter($iter))
-- 
self-producing in perl :
$_=q(print"\$_=q($_);eval;");eval;
					-- V Vinay


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

Date: 11 Oct 2004 09:36:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: function overload (not operator overload)
Message-Id: <ckdk7p$fao$2@mamenchi.zrz.TU-Berlin.DE>

Ying-Chieh Liao  <ijliao@csie.nctu.edu.tw> wrote in comp.lang.perl.misc:
> Can I do function overload in Perl (not operator) ?
> I'd like to create a function, which accepts an object array or an
> object iterator as argument ...

Well, you mention the keyword "object".  In OO parlance this is
called method polymorphism.  Make two classes, one of arrays and
another of iterators.  Create methods of the same name in each class
that deal with their kind of object.  Then "$obj -> meth( ...)" will
call the right method, whether $obj is an array or an iterator.

> I've googled "perl function overload", but all I get is about operator
> overload... what can I do in my case ? (except calling them by 
> func_array(@array) and func_iter($iter))

Without classes and objects, the best you can do is write a function
that looks at its argument and decides what kind it has been given,
then acts accordingly.

Anno



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

Date: Mon, 11 Oct 2004 07:38:20 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Getopt::Long install problems
Message-Id: <LLqad.342258$mD.35854@attbi_s02>

Mark J Fenbers wrote:

> Unfortunately, my Linux box is locked tight behind a firewall
> and it has no direct Internet access, so I have to use a PC to get the file

Have you considered installing Perl on that very PC, at least enough
to get Getopt::Long working?
	-Joe


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

Date: 12 Oct 2004 00:39:09 -0700
From: IneverReadAnythingSentToMe@hotmail.com (David Filmer)
Subject: Has anyone ported Trek-80 to Perl?
Message-Id: <e4c916dd.0410112339.42fa5f94@posting.google.com>

(this is about as MISC as comp.lang.perl.misc can get...)

Not long after the epoch, there were a number of console "Star Trek"
programs (I believe the first of these was published in Dr. Dobbs
Journal - or was it Interface Age?). For a screenshot of an early Trek
game, see http://www.thebattles.net/sol20/tinytrek/tinytrek.gif.

Anyway, the game underwent many variations. One of the most
significant was Trek80 (written in BASIC for the Radio Shack TRS-80) -
see http://www.thebattles.net/sol20/images/trk80.gif for a screenshot.
The sourcecode was published (in book form), and I once bought this
book and converted (and significantly enhanced) the code for
QuickBASIC (alas, long since lost to binary heaven).

I've found ports of this Trek80 code to other languages (a couple of
C/C++ versions, and there's a Fortran77 version on SourceForge). But
I've been unable to find a Perl port of Trek80.

I've thought about (just for kicks) playing around with the program in
Perl (although I've long since lost my TRS-80 sourcecode book), but I
would rather begin with an investigation of prior art (I've got a real
CPAN mentality these days).  Has anyone ever seen such a port? Can you
provide a link?

Thanks!


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

Date: Tue, 12 Oct 2004 16:29:01 GMT
From: MPB <justme@fakedomain.net>
Subject: Re: Has anyone ported Trek-80 to Perl?
Message-Id: <opsfrmqnax54150k@pls026981.mw.nos.boeing.com>

On 12 Oct 2004 00:39:09 -0700, David Filmer <IneverReadAnythingSentToMe@hotmail.com> wrote:

> I've found ports of this Trek80 code to other languages (a couple of
> C/C++ versions, and there's a Fortran77 version on SourceForge). But
> I've been unable to find a Perl port of Trek80.

	I have a VAX-VMS Fortran version I created from the
	Basic code I "found" on an HP-2000F in the mid-1970s.

	Unfortunately, the only sourcecode I have is on paper
	and on an Amiga disk (with no easy path from the Amiga
	to a PC).

		Mike


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

Date: 12 Oct 2004 03:17:35 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Has anyone ported Trek-80 to Perl?
Message-Id: <1097576311.my8FovGeDn1aCdm+UO2cQg@teranews>

>>>>> "David" == David Filmer <IneverReadAnythingSentToMe@hotmail.com> writes:

David> Not long after the epoch, there were a number of console "Star Trek"
David> programs (I believe the first of these was published in Dr. Dobbs
David> Journal - or was it Interface Age?). For a screenshot of an early Trek
David> game, see http://www.thebattles.net/sol20/tinytrek/tinytrek.gif.

Ouch.  That's a screencapture of a Sol 20, which I *still* have in my
storage shed.  It's the very first computer I owned.

David>   Has anyone ever seen such a port? Can you provide a link?

I don't recall.  But let me know if you see one!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Tue, 12 Oct 2004 02:17:17 -0700
From: MrReallyVeryNice <MrReallyVeryNice.REMOVE.NO.SPAM@Yahoo.REMOVE.NO.SPAM.com>
Subject: Re: how do i automatically close a Msgbox based on a timer?
Message-Id: <INadnSoUNpaDPPbcRVn-sw@comcast.com>

Darc wrote:
> thanks MrReallyVeryNice. looks like a great script except i got this error
> when i tried to run it:
> 
> The system cannot find the file specified.
> 1 at test.pl line 33.
> Couldn't unlink \s34k. : No such file or directory at test.pl line 42.
> END failed--call queue aborted.

OK, so let's debug a little bit.  If you look at line 33 you will see:
       'c:/Program Files/ActivePerl5.8.build806/bin/perl.exe',
This is the location of the perl executable on my computer.

It is unlikely that you installed Perl in the same location. You simply 
will have to find the information that pertains to the perl installation 
on your computer. It might be:
       'c:/perl/bin/perl.exe',
or
       'c:/Program Files/perl/bin/perl.exe',
or some other location.

Easy enough, right?

MrReallyVeryNice




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

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


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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

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

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


------------------------------
End of Perl-Users Digest V10 Issue 7233
***************************************


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