[6586] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 211 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 31 21:16:51 1997

Date: Mon, 31 Mar 97 18:00:24 -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, 31 Mar 1997     Volume: 8 Number: 211

Today's topics:
     Re: $^O (Mike Stok)
     Re: Date-Time Conversion:  backwards <rcadmus@mcmsys.com>
     Date <panason@usa.net>
     Re: Date (Nathan V. Patwardhan)
     Re: Debugger probs in 5.003_91/5.003_93 (Ilya Zakharevich)
     Re: Debugger probs in 5.003_91/5.003_93 (Larry Prall)
     Re: Finding first day of a month (Mike Stok)
     Re: Functions and operators (Abigail)
     Re: Has anyone heard the rumour that Microsoft have bou <martin@visual-dreams.demon.co.uk>
     Re: Help: date and time (Mike Stok)
     How Do I Use Perl To... <bradenb@ibm.net>
     Re: How Do I Use Perl To... (Nathan V. Patwardhan)
     Re: How run Perl locally? (etta)
     Re: how to check Backslash? (Mike Stok)
     Re: How to set up Perl on MS Frontpage97 <martin@visual-dreams.demon.co.uk>
     Re: How to set up Perl on MS Frontpage97 <martin@visual-dreams.demon.co.uk>
     Informix and Perl5 installation question <sen@novator.com>
     JOB OPENING <chucko@judds.com>
     Re: Live Randal Schwartz interview <jdt@insight.att.com>
     Passing an array (@abc) to a Perl extension routine <ting@platinum.com>
     seeking easier pack/unpack from integer to 4-byte hex lhollman@nicom.com
     Symbol resolution errors - 5.00395 build <don@mote.org>
     Re: Type glob/ max # of files (Mike Stok)
     Re: Win32 Problems <mkruse@shamu.netexpress.net>
     Re: Wrapping text in perl <rcadmus@mcmsys.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 1 Apr 1997 00:45:34 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: $^O
Message-Id: <5hplre$fck@news-central.tiac.net>

In article <m33etb7sxv.fsf@vorlon.mit.edu>,
Melissa Algeo  <melissa@vorlon.mit.edu> wrote:
>
>How do I use the special variable $^O?  Am I supposed to initialize
>it or otherwise do something to it?  The following line
>
>print "OS is $^O\n";

Check the version of perl you're using, the earliest I have to hand is
5.003 and it says:

[mike@localhost mike]$ /usr/bin/perl -e 'print "OS is $^O\n"'                
OS is linux

You might be able to say something like

  use Config;

  print "OS is $Config{osname}\n";

and get a useful result.

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: 31 Mar 97 21:05:23 GMT
From: "Ray Cadmus" <rcadmus@mcmsys.com>
Subject: Re: Date-Time Conversion:  backwards
Message-Id: <01bc3e17$3e84c5f0$9492140a@cbs07>

timelocal() is the inverse of localtime() - should do it for you.  Should
be in the standard PERL library.

I found reference to this in "Programming PERL"


> > What I need is a script-snip that will convert a date-time entry into
> > perl time format, i.e.  convert 03/28/96 into the number of seconds
> > since January 1 1970 (the exact opposite of the time function).



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

Date: Tue, 01 Apr 1997 01:17:48 +0200
From: Panason <panason@usa.net>
Subject: Date
Message-Id: <3340461C.33F1@usa.net>

How do I get my program to let me know todays date?

Regards,

Gunnar Ugland


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

Date: 1 Apr 1997 01:19:48 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Date
Message-Id: <5hpnrk$enc@fridge-nf0.shore.net>

Panason (panason@usa.net) wrote:
: How do I get my program to let me know todays date?

How do you grep the Perl documentation for localtime() ?  :-)
I'll leave the details of using localtime() up to you.

perl -e '$cur_date = localtime; print $cur_date,"\n";'

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 31 Mar 1997 23:45:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Debugger probs in 5.003_91/5.003_93
Message-Id: <5hpiac$gun$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Prall 
<larry@lccinc.com>],
who wrote in article <333FFBD6.3C90@lccinc.com>:
> When using the debugger with 5.003_91, I tried to set print actions
> (e.g. '< print $_, "\n";') but found that the commands were being
> printed (completely, and without interpolation), so that after each
> prompt following the above command:
> 
> print $_, "\n";
> 
> would print, but that wasn't particularly helpful, since it didn't tell
> me anything I didn't already know.

Currently $_ is set to the executed code when <-actions are processed,
so you basically got self-printing action ;-). 

--- lib/perl5db.pl~	Tue Mar  4 17:15:47 1997
+++ lib/perl5db.pl	Mon Mar 31 18:42:25 1997
@@ -410,7 +410,9 @@ sub DB {
     $evalarg = $action, &eval if $action;
     if ($single || $was_signal) {
 	local $level = $level + 1;
-	map {$evalarg = $_, &eval} @$pre;
+	foreach $evalarg (@$pre) {
+	  &eval;
+	}
 	print $OUT $#stack . " levels deep in subroutine calls!\n"
 	  if $single & 4;
 	$start = $line;
@@ -1074,7 +1076,9 @@ sub DB {
 	    }
 	}			# CMD:
 	$exiting = 1 unless defined $cmd;
-        map {$evalarg = $_; &eval} @$post;
+	foreach $evalarg (@$post) {
+	  &eval;
+	}
     }				# if ($single || $signal)
     ($@, $!, $,, $/, $\, $^W) = @saved;
     ();

Enjoy,
Ilya


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

Date: Mon, 31 Mar 1997 20:34:59 -0500
From: lgp@mindspring.com (Larry Prall)
Subject: Re: Debugger probs in 5.003_91/5.003_93
Message-Id: <lgp-ya02408000R3103972034590001@news.mindspring.com>

In article <5hpiac$gun$1@mathserv.mps.ohio-state.edu>,
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:

> Currently $_ is set to the executed code when <-actions are processed,
> so you basically got self-printing action ;-). 

Thanks for the info.  Nice to know, but now how do I print the value of $_
within _my_ code?

Cheers!
Larry


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

Date: 1 Apr 1997 00:24:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Finding first day of a month
Message-Id: <5hpkjo$e0u@news-central.tiac.net>

In article <33400739.4B4D@vcd.hp.com>,
Scott Kinard  <skinnard@vcd.hp.com> wrote:

>  I need a method to get the first day of the week for a given month
>during
>a year. 

>Here's the JavaScript method I'd like to emulate:
>
> Start = new Date("March 1,1997");
> Day = Start.getDay();
>
>In this case, Start.getDay() will return the day of the week as an
>integer
>where 0=Sunday, 1=Monday, etc.

  use Date::Parse;

  $date = str2time '1 Mar 1997';
  $day = (localtime $date)[6];

will get you a day number where Sunday is 0 from a date string if you're
using perl 5 and Graham Barr's TimeDate modules available from CPAN (check
out http://www.perl.com/CPAN/ to be multiplexed to a CPAN site or use ftp
to ftp.funet.fi and look in /pub/languages/perl/CPAN to find a list of
sites)

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: Mon, 31 Mar 1997 22:41:14 GMT
From: abigail@ny.fnx.com (Abigail)
Subject: Re: Functions and operators
Message-Id: <E7xJ0r.6Dw@nonexistent.com>

On Mon, 31 Mar 1997 06:11:16 GMT, Mark wrote in comp.lang.perl.misc:
++ 
++ The comma is a syntactic element, the same way a paren or a dollar
++ sign is syntactic in certain contexts.  Comma is part of the syntax of
++ a function/sub/etc
++ 


Did you report it as an entry for the Camel errata list? The Camel
thinks it's an operator. It even has a section about it.


Abigail



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

Date: Mon, 31 Mar 1997 23:05:22 GMT
From: "Martin Moore" <martin@visual-dreams.demon.co.uk>
Subject: Re: Has anyone heard the rumour that Microsoft have bought Perl?
Message-Id: <01bc3e27$ff251c00$0100000a@visual-dreams.demon.co.uk>

Yeah, didn't Bill Gates also say he was going to make M$ a non-profit org.
by the end of April
too?? I am sure I got that from the same authority, errm, alt.are.you.mad I
think?

-]M[ (UNIX Challenged, WWW Challenged, Challenged!)

Thomas A. Horsley <Tom.Horsley@worldnet.att.net> wrote in article
<uwwqpnnlb.fsf@worldnet.att.net>...
> >Suffice it to say that this must be some new use of the term
> >"on good authority" that I'm not familiar with.
> 
> Well, we were making jokes about it over in perl5-porters a few days ago.
> That *must* be a good authority :-).
> 


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

Date: 1 Apr 1997 00:35:43 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Help: date and time
Message-Id: <5hpl8v$eos@news-central.tiac.net>

In article <Pine.SUN.3.95.970331144144.26791A-100000@ernie.eecs.uic.edu>,
Alex Mak  <amak@ernie.eecs.uic.edu> wrote:

>I am hoping to write a sub that would take
>a year and a month as parameters and return the
>day of the week of that month.
>
>i.e:
>
>   print 'first day of month: ', &firstDayOfMonth(3,1997);  
>
>would return 6 for saturday.
>
>what is my best approach?

If you're using perl 5 then there's the Time::Local module supplied as
standard (or if you're using a vintage perl you can require the
timelocal.pl library) and are interested in the range of dates which are
represented successflly in the seconds since midnight at the beginning of
January the first 1970 representation used in unix then somehting like

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

use strict;
use Time::Local;

sub firstDayOfMonth {
  my ($month, $year) = @_;

  return (localtime timelocal 0, 0, 0, 1, $month - 1, $year - 1900)[6];
}

print 'first day of month: ', &firstDayOfMonth (3 ,1997), "\n";

__END__

mihgt be a place to start.

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: Mon, 31 Mar 1997 19:35:53 -0500
From: Jerome Bradenbaugh Bradenbaugh <bradenb@ibm.net>
Subject: How Do I Use Perl To...
Message-Id: <334057F9.7B01@ibm.net>

If I want to change the location of the document in my browser, I write
something to the following effect:

Print "Location: newpage.html\n";

Fair enough, but how do I open new pages in different frames?

Please respond to the following e-mail address:

bradenb@ibm.net

Regards,

Jerry Bradenbaugh


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

Date: 1 Apr 1997 01:24:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: How Do I Use Perl To...
Message-Id: <5hpo47$enc@fridge-nf0.shore.net>

Jerome Bradenbaugh Bradenbaugh (bradenb@ibm.net) wrote:

: Print "Location: newpage.html\n";

When did Perl start using Print?  I think you're looking for print.  :-)

: Fair enough, but how do I open new pages in different frames?

(1) See the frameset.cgi example which is included with CGI.pm
(2) Please ask any/all CGI questions in comp.infosystems.www.authoring.cgi
(3) Please refer to the weekly documents: 
	"Getting the most out of comp.lang.perl.misc," and
	"Choosing good subject lines"
(4) Please do NOT post CGI questions to comp.lang.perl.tk - PerlTk is a
    graphical extension to Perl which has nothing to do with CGI programs.

Follow-ups set.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Tue, 01 Apr 1997 01:32:44 GMT
From: etta@worldnet.att.net (etta)
Subject: Re: How run Perl locally?
Message-Id: <5hpokf$e1g@mtinsc03.worldnet.att.net>


well what I did was to load the dos command line and change dir to
perl. If the file is located in perl bin the go there and type:  perl
file.pl
file being the name of the file. Or you can get pfe at:  

http://www.lancs.ac.uk/people/cpaap/pfe/

Not only will it run it for you put you can use it as a text editor to
type your perl programs.

Hope this helps

etta

Kjetil Palmquist <kjetilpa@a.sol.no> wrote:

>I have installed Perl on my Win95 computer, and wonder how I run the
>example scripts included.


>When the script is placed on the web-server, I understand that the line
>i.e
>#!/local/perl
>is included in the script.

>But how shall this be handled when the script is run locally on my
>WinPC?

>Please reply to: kjetilpa@a.sol.no




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

Date: 1 Apr 1997 00:27:13 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: how to check Backslash?
Message-Id: <5hpkp1$e56@news-central.tiac.net>

In article <5homut$l0p$1@mhafc.production.compuserve.com>,
Connie Mueller-Goedecke  <101233.3236@CompuServe.COM> wrote:
>Hello from Hamburg!
>My aim is: I have the path- and filename-information in a string 
>(e.g. c:\myprog\sample.txt)
>Now I want to check each letter to localize the backslash that I 
>can cut the filename. 
>
>I have one problem with the right syntax: 
>Now: how do I compare with '/'?
>
>if ($lastletter eq a) <- that's not a problem. 
>But: how to write:  if ($lastletter eq /)?
>
>thanks, 
>Connie Mueller-Goedecke
>cmg@avantart.com

Newsgroups: comp.lang.perl.misc
Subject: Re: how to check Backslash?
Summary: 
Expires: 
References: <5homut$l0p$1@mhafc.production.compuserve.com>
Sender: 
Followup-To: 
Reply-To: mike@stok.co.uk
Distribution: 
Organization: Pencom Systems Administration
Keywords: 
Cc: cmg@avantart.com

In article <5homut$l0p$1@mhafc.production.compuserve.com>,
Connie Mueller-Goedecke  <101233.3236@CompuServe.COM> wrote:
>Hello from Hamburg!
>My aim is: I have the path- and filename-information in a string 
>(e.g. c:\myprog\sample.txt)
>Now I want to check each letter to localize the backslash that I 
>can cut the filename. 
>
>I have one problem with the right syntax: 
>Now: how do I compare with '/'?
>
>if ($lastletter eq a) <- that's not a problem. 
>But: how to write:  if ($lastletter eq /)?

You might want to consider using -w when you run perl as perl is most
likely interpreting a as 'a' ... if you ever had a subroutine called
declared before that condition then you may be surprised:

#!/usr/local/bin/perl

print "Equal 1\n" if 'a' eq a;

sub a { return 'b' }

print "Equal 2\n" if 'a' eq a;

__END__

only produces the Equal 1 message, using -w produces this warning:

Unquoted string "a" may clash with future reserved word at try.pl line 3.

and using the use strict; pragma produces the fatal compile time error:

Bareword "a" not allowed while "strict subs" in use at ./try.pl line 5.

The answer to your original question is 

  if ($lastletter eq '/') {
    ...
  }

but if File::Basename is distributed with your distribution of perl you
might want to use it to do filename manipulation.

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: Mon, 31 Mar 1997 23:02:08 GMT
From: "Martin Moore" <martin@visual-dreams.demon.co.uk>
Subject: Re: How to set up Perl on MS Frontpage97
Message-Id: <01bc3e26$0c8a4980$0100000a@visual-dreams.demon.co.uk>

Indeed, Frontpage is an HTML editor, and to some of us "hard-liners" not
a very good one (although, those trapped in the M$ way, and those that
enjoy simple, WYSIWYG, "visual" stuff, it's a pretty good editor) Anyway,
back to the point...

Frontpage is also packaged with it's own server.. In fact, to make matters
worse, the First frontpage had the Frontpage server, the '97 version has
the MS Personal Web server. From what I can see, there is nothing to
stop you from having Perl working from either (however, I think the
personal
server needs to be removed and use the older version, also available to
'97 users, I hope) - As I have not yet been able to get Perl and IIS
working
properly :( I cannot help furthur, but those who have, might be able to
shed
some common light onto the concepts involved..

-]M[

Kevlar <kevlar@ns.net> wrote in article <333DC4C0.60D0@ns.net>...
> Da Man wrote:
> > 
> > Can someone help me? I am a beginning Perl programmer. Could someone
> > please tell me how to set up Perl on a frontpage server and if there 
> > is something I need to put into each of my programs. Please??????
> > 
> > Dan
> 
> Do you mean M$ Internet Information Server?  Frontpage is a M$ HTML
> editor.  And not a very good one at that, but anyways...it is a client
> application, not server.  You've stated that you are a beginning perl
> programmer (this is a good thing, welcome!) but what is your concept of
> perl at this stage?  A CGI widget?  And what are your "programs",
> exactly?  "Help me help you"...
> 
> Regards,
> 
> Kevin
> <kevlar@ns.net>
> 


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

Date: Mon, 31 Mar 1997 23:02:10 GMT
From: "Martin Moore" <martin@visual-dreams.demon.co.uk>
Subject: Re: How to set up Perl on MS Frontpage97
Message-Id: <01bc3e27$43f1d4a0$0100000a@visual-dreams.demon.co.uk>

Damn, I have written this twice, both crashed (Thanks M$)

Anyway, now a very brief version.

1) Frontpage is good for those who are used to the M$ way, those that like
    WYSIWYG (wow, does anyone use that term anymore? ;), or "Visual"
    type stuff... But you are right, there are better (Like vi ;)

2) Frontpage _is_ packaged with a server, as it's the only way to work with
    it (well, easily anyway.) and to sort of correct myself, Frontpage
('97) is
    packaged with two servers, the Frontpage server (the only one there
used
    to be with previous versions of FP) and the "personal" web server (as
per
    MS coverdisc fame) - In many peoples eyes, including some at MS
support,
    The personal server should be filed in /dev/null (deleted for the UNIX
    challenged ;)

3ish) Ok, from what I can see, it seems there are some similar traits to
        both IIS and the FP server, so it might be possible. The bad news
is,
        I still can't get Perl 5 and IIS working together :( so I can't
personally
        help any furthur.... However, those that are using IIS and Perl
might
        be able to shed some common light, perhaps it is a very simple
config.
        or registry setting..

 Good luck,

-]M[ (Still looking for a UNIX prompt again *sigh* one can never give up :(
    )

Kevlar <kevlar@ns.net> wrote in article <333DC4C0.60D0@ns.net>...
> Da Man wrote:
> > 
> > Can someone help me? I am a beginning Perl programmer. Could someone
> > please tell me how to set up Perl on a frontpage server and if there 
> > is something I need to put into each of my programs. Please??????
> > 
> > Dan
> 
> Do you mean M$ Internet Information Server?  Frontpage is a M$ HTML
> editor.  And not a very good one at that, but anyways...it is a client
> application, not server.  You've stated that you are a beginning perl
> programmer (this is a good thing, welcome!) but what is your concept of
> perl at this stage?  A CGI widget?  And what are your "programs",
> exactly?  "Help me help you"...
> 
> Regards,
> 
> Kevin
> <kevlar@ns.net>
> 


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

Date: Mon, 31 Mar 1997 18:10:07 -0500
From: Li Sen <sen@novator.com>
Subject: Informix and Perl5 installation question
Message-Id: <3340444F.78D@novator.com>

Hi all,

I am having problems with Informix and Perl5.  I have installed DBI
v0.77, and DBD::Informix v0.53 and the installation proceeds without
errors.  However, when I try to use the Informix.pm module by trying to
do a simple connect, everything craps out on me.  I get a read-only
error, but, all the files have the proper permissions.  Did anyone else
encounter this?  Anyone have any pointers on how I can get things going?
BTW, I am running Solaris 2.5.1.



Thanks,


Li Sen
sen@novator.com


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

Date: Mon, 31 Mar 1997 20:21:22 -0500
From: Chuck O'Keeffe <chucko@judds.com>
Subject: JOB OPENING
Message-Id: <33406312.70A3@judds.com>

The following job opening is now available.  Please reply to 
chucko@judds.com with cover letter, resume, code samples, and
URL's of your work.  Thank you!

=============================================================

Judd's, Incorporated / Shenandoah Division

Job Title:  Internet/Intranet Programmer

Department:  OnLine Services, Information Services Division

Essential Functions:

* Design and develop client side and server side applications 
  utilizing Visual Basic Script and Java Script.
* Design and develop data driven dynamic HTML documents using 
  corporate standard database development tools including MS 
  Access and MS SQL Server.
* Provide technical and end user documentation for all 
  applications developed.
* Interface with customers during development process.
* Develop custom 'web objects' such as Java applets and 
  ActiveX controls using Java and Visual Basic 5.0.

Physical Requirements:

* Ability to move throughout the Shenandoah Division Facility.
* Manual dexterity associated with keyboard skills (or 
  equivalent adaptive technology skills.)
* Visual acuity sufficient to use high resolution computer 
  monitors (or equivalent adaptive technology skills.)

Qualifications:

(Salary commensurate with ability to meet or exceed qualifications)

* B.S. degree in Computer Science or equivalent experience
* Professional experience required in the following areas:
* Client and Server Side Scripting in VBScript/JavaScript
* Microsoft SQL Server/Microsoft Access
* Microsoft Office
* Windows NT/Windows 95
* Front Page/Visual InterDev
* HTML
* Microsoft Internet Information Server
* Microsoft Index Server
* Java and Visual Basic 5.0 Programming

* Experience in the following areas desired but not required:
* Asymetrix Infomodeler
* Object Oriented design methodologies such as Booch or OMT
* C/C++
* Perl

* Excellent verbal and written skills
* Ability to work well with a variety of people
* Ability to quickly learn and readily adapt to new technologies
* Ability to travel occasionally


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

Date: Mon, 31 Mar 1997 18:12:50 -0500
From: "J. Trudel" <jdt@insight.att.com>
Subject: Re: Live Randal Schwartz interview
Message-Id: <334044F2.4487@insight.att.com>

For some reason, I saw this and wondered what a Dead Randal
Schwartz interview would be like.

						Snidely,
						Jon


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

Date: 1 Apr 1997 00:07:14 GMT
From: "Wen Ting" <ting@platinum.com>
Subject: Passing an array (@abc) to a Perl extension routine
Message-Id: <01bc3e30$ea81f8f0$1e2611ac@tingw>

Does anybody have successful experience of passing an array to a Perl
extension?

For example,
in my Perl script:

@stringary = ("abc", "def") ;
Module::Function(stringary);

in my Perl extension routine
Function(stringary)
   char ** stringary;

I think it should work, but it does not.  Any advice is appreciated.

wen



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

Date: Mon, 31 Mar 1997 19:41:20 -0600
From: lhollman@nicom.com
Subject: seeking easier pack/unpack from integer to 4-byte hex
Message-Id: <859858415.27992@dejanews.com>

Hello,

I'm trying to convert an integer into hex format for a MIDI application. 
I need to write out a 4 byte hex representation of a number, e.g.:

136          becomes          00 00 00 88

or

1336336  becomes          00 14 64 10


My first attempt was:

#!/usr/bin/perl -w
my $note_length = '136';
print unpack ("H8", pack ("I", $note_length));

which returned:

88000000

My workaround was to manually reverse the order of the bytes:

#!/usr/bin/perl -w
my $note_length = 136;

my $backward = unpack ("H8", pack ("I", $note_length));
$backward =~ s/([\d]{2})/$1:/g;
my @queue = split /:/, $backward;
while ($_ = pop @queue) {
    print "$_ ";
}

which gave the desired:

00 00 00 88

but I'm wondering if there wasn't a way to accomplish the same thing
using a different pack/unpack statement.

Thanks for your help.

Lance Hollman

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 31 Mar 1997 19:44:14 -0500
From: Don Hayward <don@mote.org>
Subject: Symbol resolution errors - 5.00395 build
Message-Id: <Pine.LNX.3.96.970331192619.13025A-100000@ajaia>

I don't know if this is the proper forum for this.  If not. please
point me toward it.

I'm trying to build perl5.003_95,

on linux-2.0.25, using gcc-2.7.2.1, libc-5.4.23.  I've tried several
different variations in config.sh, but the same errors of the form
'can't resolv symbol' continue to occur in make test and harness. (see
below) I think these functions are available in my libraries -

Thanks. I'd appreciate any help.

don

------ make test output -----

lib/db-recno......perl: can't resolve symbol 'mkstemp'
perl: can't resolve symbol 'mkstemp'
perl: can't resolve symbol 'fsync'

lib/gdbm..........perl: can't resolve symbol 'fsync'
perl: can't resolve symbol 'fsync'

lib/ndbm..........perl: can't resolve symbol 'fsync'
perl: can't resolve symbol 'fsync'

lib/odbm..........perl: can't resolve symbol 'fsync'
perl: can't resolve symbol 'fsync'

lib/posix.........perl: can't resolve symbol 'sigaddset'


Don Hayward			don@mote.org
Mote Marine Laboratory		Voice: 941.388.4441
1600 Ken Thompson Parkway	Fax: 941.388.4312
Sarasota, FL 34236		See: http://www.mote.org
Independent, non-profit, marine and estuarine research and education facility. 
For PGP public key do: finger don@ajaia.mote.org
require "disclaimer.pl"; # We run Linux



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

Date: 1 Apr 1997 01:07:34 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Type glob/ max # of files
Message-Id: <5hpn4m$gup@news-central.tiac.net>

In article <01bc3e20$f5d23180$8b7a13c0@stcpd-pc.micro.lucent.com>,
Pat Doran <stcpjd@micro.lucent.com> wrote:

>I have a simple PERL script that uses a type glob to count the number of
>files in a directory older than certain age. It seems to work fine for all
>my directory's except one. This directory also has a HUGE amount of small
>files !!!! 
>
>Is there a limit to the number of files that perl can loop through (this
>does not seem to make sense) or is my script messed up (I am hoping this is
>the case) ??? 

The file name globbing in perl makes use of the (dreaded) C shell which
has some limitations.  The new improved perl FAQ which is at
http://www.perl.com/FAQ/ as well as in the new perl 5.004 (beta)
distibution says:

Why do I sometimes get an "Argument list too long" when I use <*>?
 
   The <> operator performs a globbing operation (see above). By default
   glob forks csh to do the actual glob exansion, but csh can't handle
   more than 127 items and so gives the error message Argument list too
   long. People who installed tcsh as csh won't have this problem, but
   their users may be surprised by it.
 
   To get around this, either do the glob yourself with Dirhandles and
   patterns, or use a module like Glob::KGlob, one that doesn't use the
   shell to do globbing.
 
     * Back to How come when I open the file read-write it wipes it out?
     * Forward to Is there a leak/bug in glob()?
     * Up to the perlfaq5 manpage

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: 31 Mar 1997 23:44:57 GMT
From: Matt Kruse <mkruse@shamu.netexpress.net>
Subject: Re: Win32 Problems
Message-Id: <5hpi9p$na8@news1-alterdial.uu.net>

Suggestion: Start your post with your question, followed by a very short 
summary.  then go into detail, if necessary.

I doubt anyone will read your post, because:
1) the first screen i see tells me nothing about what you want to know
2) using 'win32' in your subject will get you killed by most skilled 
   readers of the group
3) you have blank lines which makes your post long and hard to read
4) the code is long and we dont know what it does, and you dont tell us
   exactly what you're trying to do.

A better post might have said something like:

Using perl 5 on win32, I am trying to open notepad, then close it after a 
certain amount of time.  I can successfully open notepad, but I cannot 
get it to close.  How can I force notepad to close?

The code that is supposed to close notepad is:
   ...blah blah blah...

The entire piece of code is:
   ...blah blah blah...

Thanks!


Just some suggestions.  And no, I dont know the answer :)


Arnold Gavurin <agavurin@ix.netcom.com> wrote:
: Enclosed is a slightly modified example taken from the Win32

: documentation:



: ------------------------------------------------------------------------

: # 

: # Launch a Windows process from Win32 module.

: # See online docs for more on this subject.

: #

: use Win32;

: use Win32::Process;



: #Create the process object.

: Win32::Process::Create($ProcessObj, 

:     "D:\\WINNT35\\NOTEPAD.EXE",

:     "NOTEPAD",

:     0, # Don't inherit.

:     DETACHED_PROCESS,

:     ".") ||  # current dir.

:     die &print_error;



: #Wait for the process to end. No timeout. 

: $ProcessObj->Wait(INFINITE) || 

:     warn &print_error;



: $ProcessObj->GetExitCode($ExitCode) || 

:     warn &print_error;



: print "Notepad exited with $ExitCode\n";



: sub print_error {

:     print Win32::FormatMessage( Win32::GetLastError() );

: }



: # winapp.pl



: ---------------------------------------------------------------------



: This example starts the notepad. (I am using windows nt 3.51). Note the

: statement:



: $ProcessObj->Wait(INFINITE) || 

:     warn &print_error;



: The comment seems to tell me that I have change the "INFINITE" to some

: value in

: milliseconds that the process (notepad) should terminate after that time

: elapses

: I have tried different times and notepad never terminates.



: Questions:

: 1) Has anyone used this?

: 2) Does it work on your workstation?

: 3) I have a copy of "Cross Platform PERL". It covers NT albiet

: breifly. Any books were there is more detail and EXAMPLES?



: Arnold Gavurin

-- 
Matt Kruse
mkruse@netexpress.net
http://www.netexpress.net/~mkruse/                  http://www.mkstats.com/
---------------------------------------------------------------------------
Unsolicited advertising of any type to this addresss will not be tolerated.


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

Date: 31 Mar 97 22:01:32 GMT
From: "Ray Cadmus" <rcadmus@mcmsys.com>
Subject: Re: Wrapping text in perl
Message-Id: <01bc3e1f$16c63cd0$9492140a@cbs07>

Alan Bond <alanbond@sky.net> wrote in article <333B47ED.7312@sky.net>...

> I have a string that represents the contents of a text field from
> a form.  The text field on the form has auto-wrapping.  When my
> perl program gets the string, it is one long string.  Does anyone
> know a snippet of code I could use to reformat the string and insert
> newline characters at whitespace after, say 40 characters?

I see that someone has already recommended the wrap:: module - that should
do it.

Another way (simple - I like simple) is this substitution...

  s/(.{1,40})\s+/$1\n/g;

Assumes that the string is still in $_.

I'm sorry that I don't remember who posted this but I found it on this
newsgroup at one time.

A third way is to use the PERL format facility...

# wrap words to 70 chars per line

while (<>) {
   write;
}

format STDOUT=
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$_
 .




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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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