[24666] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6830 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 3 14:57:36 2004

Date: Tue, 3 Aug 2004 11:56:40 -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, 3 Aug 2004     Volume: 10 Number: 6830

Today's topics:
    Re: Validate only a subset of a document (wooks)
        Variable interpolation on STDIN ?  <matrix_calling@yahoo.dot.com>
    Re: Variable interpolation on STDIN ?  <notvalid@email.com>
    Re: Variable interpolation on STDIN ?  <matrix_calling@yahoo.dot.com>
    Re: Variable interpolation on STDIN ? <usenet@plenz.com>
    Re: Variable interpolation on STDIN ? <matrix_calling@yahoo.dot.com>
    Re: Variable interpolation on STDIN ? <for-spammers-only@web.de>
    Re: Variable interpolation on STDIN ? (Anno Siegel)
    Re: Variable interpolation on STDIN ? <matrix_calling@yahoo.dot.com>
    Re: Variable interpolation on STDIN ? <matrix_calling@yahoo.dot.com>
        Want Microsoft Windows screen scraping code (Kevin Cline)
    Re: Want Microsoft Windows screen scraping code <invalid-email@rochester.rr.com>
    Re: Want Microsoft Windows screen scraping code <bart.lateur@pandora.be>
    Re: Want Microsoft Windows screen scraping code (Kevin Cline)
        What does "exit the block or routine with a loop contro <initiallast-name@yahoo.xyz>
    Re: What does "exit the block or routine with a loop co <invalid-email@rochester.rr.com>
    Re: What does "exit the block or routine with a loop co <remorse@partners.org>
    Re: What does "exit the block or routine with a loop co <nobull@mail.com>
    Re: What should I use: qx or system? <jgibson@mail.arc.nasa.gov>
    Re: What should I use: qx or system? <Joe.Smith@inwap.com>
    Re: What should I use: qx or system? <usenet@morrow.me.uk>
        Which module for variable-length binary db file? <corff@cis.fu-berlin.de>
    Re: Which module for variable-length binary db file? <ftoewe@austin.rr.com>
    Re: Which module for variable-length binary db file? <corff@cis.fu-berlin.de>
        Which Script Are They Using? <SaveWorldFromAids@alexa.com>
    Re: Which Script Are They Using? <shit@usenetshit.info>
    Re: Which Script Are They Using? <gnari@simnet.is>
    Re: Which Script Are They Using? greymaus@yahoo.com
    Re: Win32::OLE.pm and Hyperlinks (-b)
    Re: Win32::OLE.pm and Hyperlinks (-b)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Jul 2004 04:16:57 -0700
From: wookiz@hotmail.com (wooks)
Subject: Re: Validate only a subset of a document
Message-Id: <8852d33c.0407230316.2ced8b8a@posting.google.com>

user@domain.invalid wrote in message news:<B23Lc.37$Iu3.107@news.oracle.com>...
> Hi,
> 
> I am fairly new to XML, and would like some pointers on the following :
> 
> I need to validate a _part_ of an xml file with a schema, and do not 
> care what is there above/below that chunk. I will be using Perl for this.
> 
> The approach I can think of would be to validate against a schema with 
> everything above/below the required part as optional.
> 
> Or, I could parse the XML, extract that into a temporary file so that 
> the required xml is now a root node, and validate with a schema 
> containing only information related to that.
> 
> However, I was just wondering if there is any other simpler way to do it 
> (with Perl)? I have heard og XPath and the XML::Twig modules, but am not 
> sure if those will make my design simpler or more complex ?
> 
> Suggestions ?
> 
> TIA
> Am


http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&safe=off&threadm=cd1lrt%24301t%241%40pc-news.cogsci.ed.ac.uk&prev=/groups%3Fq%3Dcomp.text.xml%26ie%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch


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

Date: Tue, 03 Aug 2004 17:00:52 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Variable interpolation on STDIN ? 
Message-Id: <POKPc.6$mP3.125@news.oracle.com>

Hi,

I am reading the name of a file from STDIN.

I am using the following :

my $fileToCheck = <STDIN>;
chomp ($fileToCheck);
if (-e $fileToCheck)
{
   print "Not Found\n";
}

The problem is that I want to allow the user to specify the file with 
environment variables in some way. For example, to check if x.pl is present 
under the home directory, the user should be able to give

$HOME/x.pl

However, it seems that we cannot interpolate like this while reading from 
STDIN (or from a file)? Am I missing something ?

I tried $ENV{HOME}/x.pl also, but it also gave the same error :

No such file or directory

TIA

--
Abhinav


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

Date: Tue, 03 Aug 2004 14:20:35 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Variable interpolation on STDIN ? 
Message-Id: <TaNPc.5863$AY5.1592@newssvr21.news.prodigy.com>

Abhinav wrote:
> if (-e $fileToCheck)
> {
>   print "Not Found\n";
> }

-e returns true if the file exists. You have your logic all mixed up.

	unless (-e $fileToCheck) {
		print "Not Found\n";
	}

--Ala



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

Date: Tue, 03 Aug 2004 20:47:59 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Re: Variable interpolation on STDIN ? 
Message-Id: <K7OPc.17$mP3.96@news.oracle.com>

Ala Qumsieh wrote:
> Abhinav wrote:
> 
>>if (-e $fileToCheck)
>>{
>>  print "Not Found\n";
>>}
> 
> 
> -e returns true if the file exists. You have your logic all mixed up.
> 

Another reason not to type in code..even if it is just a conceptual thing.

That should have read !e ..

As the other posts imply, the problem lay elsewhere.

[...]


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

Date: 3 Aug 2004 11:44:41 GMT
From: Julius Plenz <usenet@plenz.com>
Subject: Re: Variable interpolation on STDIN ?
Message-Id: <slrncguul9.ru9.usenet@plenz.com>

* Abhinav <matrix_calling@yahoo.dot.com> [2004-08-03]:
> my $fileToCheck = <STDIN>;
> chomp ($fileToCheck);
> [...]

You can write that way shorter:

chomp (my $fileToCheck = <STDIN>);

> The problem is that I want to allow the user to specify the file
> with environment variables in some way. For example, to check if
> x.pl is present under the home directory, the user should be able to
> give
> 
> $HOME/x.pl
> 
> However, it seems that we cannot interpolate like this while reading
> from STDIN (or from a file)? Am I missing something ?
> 
> I tried $ENV{HOME}/x.pl also, but it also gave the same error :

Did you also try "$ENV{HOME}/x.pl"?

Julius
-- 
www.plenz.com


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

Date: Tue, 03 Aug 2004 17:39:19 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Re: Variable interpolation on STDIN ?
Message-Id: <TmLPc.9$mP3.103@news.oracle.com>

Julius Plenz wrote:

> * Abhinav <matrix_calling@yahoo.dot.com> [2004-08-03]:
> 
>>my $fileToCheck = <STDIN>;
>>chomp ($fileToCheck);
>>[...]
> 
> 
> You can write that way shorter:
> 
> chomp (my $fileToCheck = <STDIN>);
> 
> 
>> [...]
>>However, it seems that we cannot interpolate like this while reading
>>from STDIN (or from a file)? Am I missing something ?
>>
>>I tried $ENV{HOME}/x.pl also, but it also gave the same error :
> 
> 
> Did you also try "$ENV{HOME}/x.pl"?
> 

Yes : Getting the error,
No such file or directory

Of course, if I put

$fileToCheck="$ENV{HOME}/x.pl";
instead of taking it from STDIN, it works ...

--

Abhinav


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

Date: Tue, 03 Aug 2004 14:10:32 +0200
From: Toni Erdmann <for-spammers-only@web.de>
Subject: Re: Variable interpolation on STDIN ?
Message-Id: <cenvbo$igq$1@news.mch.sbs.de>

Abhinav wrote:
> Julius Plenz wrote:
> 
>> * Abhinav <matrix_calling@yahoo.dot.com> [2004-08-03]:
>>
>>> my $fileToCheck = <STDIN>;
>>> chomp ($fileToCheck);
>>> [...]
>>
>>
>>
>> You can write that way shorter:
>>
>> chomp (my $fileToCheck = <STDIN>);
>>
>>
>>> [...]
>>> However, it seems that we cannot interpolate like this while reading
>>> from STDIN (or from a file)? Am I missing something ?
>>>
>>> I tried $ENV{HOME}/x.pl also, but it also gave the same error :
>>
>>
>>
>> Did you also try "$ENV{HOME}/x.pl"?
>>
> 
> Yes : Getting the error,
> No such file or directory
> 

What does 'print "Not Found: $fileToCheck\n";' tell you?

Toni


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

Date: 3 Aug 2004 12:19:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Variable interpolation on STDIN ?
Message-Id: <cenvt8$ro6$3@mamenchi.zrz.TU-Berlin.DE>

Abhinav  <matrix_calling@yahoo.dot.com> wrote in comp.lang.perl.misc:
> Hi,
> 
> I am reading the name of a file from STDIN.
> 
> I am using the following :
> 
> my $fileToCheck = <STDIN>;
> chomp ($fileToCheck);
> if (-e $fileToCheck)
> {
>    print "Not Found\n";
> }
> 
> The problem is that I want to allow the user to specify the file with 
> environment variables in some way. For example, to check if x.pl is present 
> under the home directory, the user should be able to give
> 
> $HOME/x.pl

Untested:

    chomp( my $fileToCheck = <STDIN>);
    $fileToCheck =~ s/\$(\w+)/$ENV{ $1}/g;

Is that what you're after?

Anno


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

Date: Tue, 03 Aug 2004 17:58:58 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Re: Variable interpolation on STDIN ?
Message-Id: <hFLPc.10$mP3.39@news.oracle.com>

Toni Erdmann wrote:

> Abhinav wrote:
> 
>>Julius Plenz wrote:
>>
>>
>>>* Abhinav <matrix_calling@yahoo.dot.com> [2004-08-03]:
>>>
>>>
>>>>my $fileToCheck = <STDIN>;
>>>>chomp ($fileToCheck);
>>>>[...]
>>>
>>>
>>>
>>>You can write that way shorter:
>>>
>>>chomp (my $fileToCheck = <STDIN>);
>>>
>>>
>>>
>>>>[...]
>>>>However, it seems that we cannot interpolate like this while reading
>>>>from STDIN (or from a file)? Am I missing something ?
>>>>
>>>>I tried $ENV{HOME}/x.pl also, but it also gave the same error :
>>>
>>>
>>>
>>>Did you also try "$ENV{HOME}/x.pl"?
>>>
>>
>>Yes : Getting the error,
>>No such file or directory
>>
> 
> 
> What does 'print "Not Found: $fileToCheck\n";' tell you?
The file is there :

(ab) newschema- ls $HOME/x.pl
/home/ab/x.pl

Test with absolute path :
(ab) newschema- perl test.pl
/home/ab/x.pl
success

Failed Tests  :

(ab) newschema- perl test.pl
"$ENV{HOME}/x.pl"
Not Found: "$ENV{HOME}/x.pl"

(ab) newschema- perl test.pl
$ENV{HOME}/x.pl
Not Found: $ENV{HOME}/x.pl

(ab) newschema- perl test.pl
~/x.pl
Not Found: ~/x.pl

(ab) newschema- perl test.pl
"$HOME/x.pl"
Not Found: "$HOME/x.pl"

(ab) newschema- perl test.pl
${HOME}/x.pl
Not Found: ${HOME}/x.pl

(ab) newschema- perl test.pl
"${HOME}/x.pl"
Not Found: "${HOME}/x.pl"

(ab) newschema- perl test.pl
$HOME/x.pl
Not Found: $HOME/x.pl

There is no variable substitution happening here..
--

Abhinav


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

Date: Tue, 03 Aug 2004 18:04:29 +0530
From: Abhinav <matrix_calling@yahoo.dot.com>
Subject: Re: Variable interpolation on STDIN ?
Message-Id: <sKLPc.11$mP3.39@news.oracle.com>

Anno Siegel wrote:

> Abhinav  <matrix_calling@yahoo.dot.com> wrote in comp.lang.perl.misc:
> 
>>Hi,
>>
>>I am reading the name of a file from STDIN.
>>
>>I am using the following :
>>
>>my $fileToCheck = <STDIN>;
>>chomp ($fileToCheck);
>>if (-e $fileToCheck)
>>{
>>   print "Not Found\n";
>>}
>>
>>The problem is that I want to allow the user to specify the file with 
>>environment variables in some way. For example, to check if x.pl is present 
>>under the home directory, the user should be able to give
>>
>>$HOME/x.pl
> 
> 
> Untested:
> 
>     chomp( my $fileToCheck = <STDIN>);
>     $fileToCheck =~ s/\$(\w+)/$ENV{ $1}/g;
> 
> Is that what you're after?
> 
Exactly !

I thought this could be done directly by reading the input, specified in 
*some* way, without having to modify it..

This is good enough :)

Thanks

--
Abhinav


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

Date: 24 Jul 2004 23:55:56 -0700
From: kevin.cline@gmail.com (Kevin Cline)
Subject: Want Microsoft Windows screen scraping code
Message-Id: <e749549b.0407242255.58324f41@posting.google.com>

I want to do some really low-level screen scraping.  Is there any
module that will read the pixels from a Microsoft Windows window?


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

Date: Sun, 25 Jul 2004 16:49:06 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Want Microsoft Windows screen scraping code
Message-Id: <4103E3E2.1080102@rochester.rr.com>

Kevin Cline wrote:

> I want to do some really low-level screen scraping.  Is there any
> module that will read the pixels from a Microsoft Windows window?
> 

CPAN is your friend:

    http://perl.com/CPAN/modules/01modules.index.html

Look for stuff with "Win32" and "Screenshot" or similar in it.

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: Mon, 26 Jul 2004 06:20:37 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Want Microsoft Windows screen scraping code
Message-Id: <ki89g0l0s088nprf0t2ts1h8k1fb2mbupr@4ax.com>

Kevin Cline wrote:

>I want to do some really low-level screen scraping.  Is there any
>module that will read the pixels from a Microsoft Windows window?

If all else faiuls, look into the Windows API. Win32::API is the
canonical module to interface to it.

Just stay away from the "new interface" for this module. Though it looks
appealing, I've had nothing but trouble with it (crashes).

-- 
	Bart.


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

Date: 2 Aug 2004 13:20:21 -0700
From: kevin.cline@gmail.com (Kevin Cline)
Subject: Re: Want Microsoft Windows screen scraping code
Message-Id: <e749549b.0408021220.414d91d1@posting.google.com>

Bart Lateur <bart.lateur@pandora.be> wrote in message news:<ki89g0l0s088nprf0t2ts1h8k1fb2mbupr@4ax.com>...
> Kevin Cline wrote:
> 
> >I want to do some really low-level screen scraping.  Is there any
> >module that will read the pixels from a Microsoft Windows window?
> 
> If all else faiuls, look into the Windows API. Win32::API is the
> canonical module to interface to it.

Thanks, all else did fail.  I'll take a look there and see if I can
figure anything out.  If I do, then I'll submit it to CPAN.


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

Date: Sat, 24 Jul 2004 03:17:24 GMT
From: "Suresh Govindachar" <initiallast-name@yahoo.xyz>
Subject: What does "exit the block or routine with a loop control operator" mean?
Message-Id: <8xkMc.3927$54.56111@typhoon.sonic.net>

Hello,

Page 789 of Programming Perl says that the block or
routine used for sorting cannot be exited "with a loop
control operator".  What does this mean?

Specifically, is the following OK or not-OK?

sub the_sorter
{
  my $rv = 0;
  for my $i(1..10)
  {
     # some code involving $a and $b
     # an assignment to $rv

     $rv and last;  # exitting the loop inside a sort subroutine.
  }
  return $rv;  # explicit return statement;  not a loop-control operator
}

I suspect the preceding is indeed OK;  please give an
example of exitting a "block or routine with a loop control operator".

Thanks,

--Suresh





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

Date: Sat, 24 Jul 2004 04:08:06 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: What does "exit the block or routine with a loop control operator" mean?
Message-Id: <4101E045.3010609@rochester.rr.com>

Suresh Govindachar wrote:

 ...

> I suspect the preceding is indeed OK;  please give an
> example of exitting a "block or routine with a loop control operator".
 ...


> --Suresh


They probably mean something like:


use warnings;
use strict;
sub test{
   print "in test\n";
   last; #terminates the for loop below
   print "still in test\n";
}
for(1..3){
   print "calling test $_\n";
   test();
   print "returned from test $_\n";
}

That gives a warning, though, at least in 5.8.4.

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: Mon, 26 Jul 2004 13:35:32 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: What does "exit the block or routine with a loop control operator" mean?
Message-Id: <remorse-9D501C.13353226072004@plato.harvard.edu>

In article <8xkMc.3927$54.56111@typhoon.sonic.net>,
 "Suresh Govindachar" <initiallast-name@yahoo.xyz> wrote:

> Hello,
> 
> Page 789 of Programming Perl says that the block or
> routine used for sorting cannot be exited "with a loop
> control operator".  What does this mean?

They are referring to exiting the direct block or subroutine you provide 
to the sort operator.  Not to a sub-block of this block.

IE, something like this is probably forbidden

sort {
   my $a_processed = do_something($a);
   my $b_processed = do_something($b);

   if (!defined($a_processed) or !defined($b_processed)) {
      next; # illegal!!!!
   }

   return $a_processed <=> $b_processed
       || $a_processed cmp $b_processed;
} @vals_to_sort;

HTH,
Ricky


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

Date: 27 Jul 2004 00:25:00 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: What does "exit the block or routine with a loop control operator" mean?
Message-Id: <u9vfgaxsfn.fsf@wcl-l.bham.ac.uk>

"Suresh Govindachar" <initiallast-name@yahoo.xyz> writes:

> Page 789 of Programming Perl says that the block or
> routine used for sorting cannot be exited "with a loop
> control operator".  What does this mean?
> 
> Specifically, is the following OK or not-OK?
> 
> sub the_sorter
> {
>   my $rv = 0;
>   for my $i(1..10)
>   {
>      # some code involving $a and $b
>      # an assignment to $rv
> 
>      $rv and last;  # exitting the loop inside a sort subroutine.
>   }
>   return $rv;  # explicit return statement;  not a loop-control operator
> }
> 
> I suspect the preceding is indeed OK;

It is just fine.

>  please give an
> example of exitting a "block or routine with a loop control
> operator".

OK first without sort.  One can use last to implement a throw/catch
type of semantic rather as you would with eval/die.

sub baz {
  no warnings 'exiting';
  print "last FOO\n";
  last FOO;
}

sub bar {
  baz();
  print "Not reached\n";
}

FOO: {
  bar();
  print "Not reached\n";
}
print "Reached\n";

__END__
 
Now if instead I replace bar with 

sub bar {
  print sort baz 1,2,3;
}

then we get an error: Label not found for "last FOO".

IMNSHO this is a bad thing.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 23 Jul 2004 16:04:07 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: What should I use: qx or system?
Message-Id: <230720041604075540%jgibson@mail.arc.nasa.gov>

In article <60233f21.0407220329.19150b11@posting.google.com>, Andreas
Kienle <andreaskienle@gmx.de> wrote:

> Hi,
> 
> I have the following problem: I want to create a perl script which
> will be used by several other scripts. The perl script should return a
> string and print something else to STDOUT.
> For example it should read a line from a file and return this to the
> calling script but printing "Read from file 'bla'" to STDOUT
> When I use system() to call the script then the printing to the screen
> works as usual but the main program cannot access the retrieved
> string. On the other hand when I use `` I can save the result in a
> variable but cannot print to the screen from the "subscript".

From what you describe, there is no need to run your common script in a
separate process. Include it as a subroutine in any program that wants
to use it. Look up Perl functions 'do', 'require', and 'use' to see how
to do that in several flavors of modularity. Put your common routine in
its own file and use one of the functions mentioned to include it in
your programs.


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

Date: Sun, 25 Jul 2004 09:28:17 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: What should I use: qx or system?
Message-Id: <R2LMc.25842$8_6.20558@attbi_s04>

Andreas Kienle wrote:

> I have the following problem: I want to create a perl script which
> will be used by several other scripts. The perl script should return a
> string and print something else to STDOUT.

In that case, you chould have the calling program open a file descriptor
such as descriptor number 4 (anything but 0, 1, 2) and have the called
program write its result to that file descriptor.  You could use a pipe
for this purpose.
	-Joe


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

Date: Fri, 23 Jul 2004 00:17:52 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: What should I use: qx or system?
Message-Id: <0iu5t1-vl5.ln1@mauzo.dyndns.org>


Quoth andreaskienle@gmx.de (Andreas Kienle):
> I have the following problem: I want to create a perl script which
> will be used by several other scripts. The perl script should return a
> string and print something else to STDOUT.
> For example it should read a line from a file and return this to the
> calling script but printing "Read from file 'bla'" to STDOUT
> When I use system() to call the script then the printing to the screen
> works as usual but the main program cannot access the retrieved
> string. On the other hand when I use `` I can save the result in a
> variable but cannot print to the screen from the "subscript".
> 
> I hope you understand what I mean

No. I don't think you do, either.

A (C, under Unixish and related OSen) program produces two forms of
output: data written to filehandles and its exit code. The exit code is
a number from 0 to 32767-ish. STDOUT is a filehandle: you can write data
to it just like any other. If you run a program with qx//, perl will
catch all the data that program writes to STDOUT and return it to you:
there is no way for the program to 'return' a separate stream of data.

I think what you want to do is print your 'Read from file' message to
STDERR, not STDOUT. Then print your output string to STDOUT and run the
program with qx//. This is why there is a separate standard error
stream: so that a program can pass separate messages to a 'calling'
program and the user.

Ben

-- 
        I must not fear. Fear is the mind-killer. I will face my fear and
        I will let it pass through me. When the fear is gone there will be 
        nothing. Only I will remain.
ben@morrow.me.uk                                          Frank Herbert, 'Dune'


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

Date: 31 Jul 2004 16:28:56 GMT
From: <corff@cis.fu-berlin.de>
Subject: Which module for variable-length binary db file?
Message-Id: <2n1vm8Fsftt3U1@uni-berlin.de>

Hello everybody,

Is there a Perl module for reading from binary files with the
following features:

1. number of fields per record varies but is stored before record
2. length of field varies but is stored before field in binary format
3. part of fields contains ASCII data, other fields UCS-2 data,
   but field length is always indicated by number of characters.
4. numerical fields are in GSM-encoded form.

The whole thing is used as directory database in mobile phones.

Thanks for any hints,

Oliver.

-- 
Dr. Oliver Corff              e-mail:    corff@zedat.fu-berlin.de


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

Date: Sat, 31 Jul 2004 19:48:32 GMT
From: "Fred Toewe" <ftoewe@austin.rr.com>
Subject: Re: Which module for variable-length binary db file?
Message-Id: <kISOc.11285$Zm3.8046@fe2.texas.rr.com>

<corff@cis.fu-berlin.de> wrote in message
news:2n1vm8Fsftt3U1@uni-berlin.de...
> Hello everybody,
>
> Is there a Perl module for reading from binary files with the
> following features:
>
> 1. number of fields per record varies but is stored before record
> 2. length of field varies but is stored before field in binary format
> 3. part of fields contains ASCII data, other fields UCS-2 data,
>    but field length is always indicated by number of characters.
> 4. numerical fields are in GSM-encoded form.
>
> The whole thing is used as directory database in mobile phones.
>
> Thanks for any hints,
>
> Oliver.
>
> -- 
> Dr. Oliver Corff              e-mail:    corff@zedat.fu-berlin.de

You really don't need a special package to do this, with the possible
exception of GSM encoded fields, with which I am not familiar.  You can read
binary files thusly:

   open( INFILE, $filename ) or die "Could not open $filename for input\n";
   binmode INFILE;
   my $buffer;
   my $length = <initial read length in bytes>;
   read( INFILE, $buffer, $length );

then you can unpack the ASCII string portions using:

  $string = unpack 'Z', $buffer;

where appropriate.

See the perl commands for open, binmode, read and pack/unpack.

Cheers,
Fred




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

Date: 1 Aug 2004 11:09:14 GMT
From: <corff@cis.fu-berlin.de>
Subject: Re: Which module for variable-length binary db file?
Message-Id: <2n41aqFshmb6U2@uni-berlin.de>

Fred Toewe <ftoewe@austin.rr.com> wrote:

[example clipped]

: See the perl commands for open, binmode, read and pack/unpack.

Hi Fred,

Thank you very much, I'll give it a try!

Oliver.



-- 
Dr. Oliver Corff              e-mail:    corff@zedat.fu-berlin.de


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

Date: Mon, 02 Aug 2004 04:20:53 GMT
From: "http://links.i6networks.com" <SaveWorldFromAids@alexa.com>
Subject: Which Script Are They Using?
Message-Id: <FijPc.1381606$Ar.158370@twister01.bloor.is.net.cable.rogers.com>

I am trying to find out what script they are using. I am sure it is in Perl,
because I saw the mainboard.pl thing after submit.

It is like a guest book, but has login/password functions, but does not
require a password, if you choose a new username. They are in Chinese, but
you are welcome to enter anything to test. You may not understand what it
says, but you can have a feel what it does, as it will output your input.

The form submit page is as:
http://www.6park.com/enter6/addnew.html

After submit it is shown as:
http://www.6park.com/enter6/first1.shtml

I think it does not use a Database, but it hardcoded the results into a
static HTML page, because each message has a .htm page




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

Date: Mon, 2 Aug 2004 16:42:52 +1000
From: brucie <shit@usenetshit.info>
Subject: Re: Which Script Are They Using?
Message-Id: <1o111lvciskcg$.dlg@usenetshit.info>

in post:
<news:FijPc.1381606$Ar.158370@twister01.bloor.is.net.cable.rogers.com>
"http://links.i6networks.com" <SaveWorldFromAids@alexa.com> said:

> I am trying to find out what script they are using. 

what did they say when you emailed them and asked?

-- 
i    h  e  a  r    v  o  i  c  e  s



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

Date: Mon, 2 Aug 2004 11:41:07 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Which Script Are They Using?
Message-Id: <cel94o$kv5$1@news.simnet.is>

"http://links.i6networks.com" <SaveWorldFromAids@alexa.com> wrote in message
news:FijPc.1381606$Ar.158370@twister01.bloor.is.net.cable.rogers.com...
> I am trying to find out what script they are using. I am sure it is in
Perl,
> because I saw the mainboard.pl thing after submit.

> I think it does not use a Database, but it hardcoded the results into a
> static HTML page, because each message has a .htm page

the extention does not mean anything.
the .pl could be a bash script, and the .htm could be cobol,
for all we know.
it is common practice to masquerade web scripts as .html

gnari






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

Date: 2 Aug 2004 21:31:57 GMT
From: greymaus@yahoo.com
Subject: Re: Which Script Are They Using?
Message-Id: <slrncgrbm6.ok.greymaus@darkstar.ie>

On Mon, 2 Aug 2004 16:42:52 +1000, brucie  wrote:
> in post:
><news:FijPc.1381606$Ar.158370@twister01.bloor.is.net.cable.rogers.com>
> "http://links.i6networks.com" <SaveWorldFromAids@alexa.com> said:
>
>> I am trying to find out what script they are using. 
>
> what did they say when you emailed them and asked?
>

What an incredibly lame proposal :)

-- 
greymaus
Al Firan RumaiDin
97.025% of statistics are wrong


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

Date: 23 Jul 2004 08:42:24 -0700
From: docuswear@yahoo.com (-b)
Subject: Re: Win32::OLE.pm and Hyperlinks
Message-Id: <4cd81ea8.0407230742.42e93140@posting.google.com>

Paul Lalli <mritty@gmail.com> wrote in message news:<20040722151505.M2467@barbara.cs.rpi.edu>...
> On Thu, 22 Jul 2004, -b wrote:
> 
> > I am using Perl and OLE.pm to read and modify an Excel spreadsheet.
> >
> >
> > I can read the hyperlinked value of a cell using the following code:
> >
> > 	my $cellObject = $worksheet->Range("A2");
> > 	my $hyperlink = $cellObject->Hyperlinks(1)->Address;
> >
> >
> >
> > Can anyone explain how to modify the value of an Excel cell's
> > hyperlink, or to add one to a cell if it has no hyperlink?
> 
> Disclaimer - I've never used this, nor tried to.
> 
> Based on MS's reference at:
> http://msdn.microsoft.com/library/en-us/off2000/html/xlobjhyperlinks.asp
> 
> I would try:
> 
> $cellObject->Hyperlinks->Add(Range('A2'), 'http://www.msdn.com');
> 
> Paul Lalli

Thanks for the effort Paul, but that did not work.  It threw an error:
"Undefined subroutine &main::Range called at line 58."

I changed the syntax around, but to no avail.
$cellObject->Hyperlinks->Add({Anchor=>('D39'),Address=>'http://www.msdn.com'});
$cellObject->Hyperlinks->Add({Range=>('D39'),Address=>'http://www.msdn.com'});
$cellObject->Hyperlinks->Add(Range=>('D39'),Address=>'http://www.msdn.com');
Nothing seems to work.


I also tried the following structure, but that did not work either.

	$worksheet->Range("D39")->Select();
	$worksheet->Hyperlinks()->Add({	Address => "C:\\temp", 
					Anchor 	=> Selected,
					TextToDisplay	=> "Automated Link",
	});

I also tried substituting 'Range("D39")' for the "Selected" value,
which did not work.

I've tried every variation I can think of, but have not been
successful yet.

-docuSwear


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

Date: 23 Jul 2004 13:09:29 -0700
From: docuswear@yahoo.com (-b)
Subject: Re: Win32::OLE.pm and Hyperlinks
Message-Id: <4cd81ea8.0407231209.524abde3@posting.google.com>

PerlMonks.org posted the correct solution to my stated problem.


	my $range1	= $worksheet->Range("D39");
	my $adr		= "http://www.StructureHomesAZ.com";
	my $txt		= "D39 TEXT";
	my $tip1	= "D39 TIP";
	$worksheet->Hyperlinks->Add({   
				Anchor          =>  $range1,
				Address         =>  $adr,
				TextToDisplay   =>  $txt,
				ScreenTip       =>  $tip1,
	});



Regards,
-docuSwear


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

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 6830
***************************************


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