PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Julian Thomas" <jthomas at globeop dot com>
Subject: RE: Problem wit loading CTLib via CGI on WinXp
Date: Feb 4 2009 3:09PM

Hi

We now have

#!d:\perl.5.8.8\bin\perl

use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
$q = new CGI;                        # create new CGI object
print $q->header, $q->start_html("File Size");
print $q->start_form;
print h1("File Size");

my $filename =
"D:\\perl.5.8.8\\site\\lib\\auto\\Sybase\\CTlib\\CTLIB.dll";
my $fh;                    # file handle
open $fh, '<', $filename
      or die "cannot open $filename for reading: $!";

$Size = -s $fh;
print p("Size of $filename = $Size bytes");

print $q->end_form,$q->hr();
print $q->end_html;

which gives us 

File Size
Size of D:\perl.5.8.8\site\lib\auto\Sybase\CTlib\CTLIB.dll = 127057
bytes

So we can obviously read the file ok
The open call from the earlier script was reading the contents of the
list box from file and that all seemed ok 

I think it must be something to do with the path of some env variable.

-----Original Message-----
From: Ed Avis [mailto:eda@waniasset.com] 
Sent: 04 February 2009 14:44
To: Julian Thomas; sybperl-l@peppler.org
Subject: RE: Problem wit loading CTLib via CGI on WinXp

Your attached test script is very complicated - it does all sorts of
stuff apart from opening a file.  Couldn't you make a simple script that
just does that?

However, it looks like the open() call is not correct - you have

    open(INTERFACES)

which will open a file called 'interfaces', and not give any error if it
fails!  You would need something like

    my $filename = 'whatever';
    my $fh;                    # file handle
    open $fh, '<', $filename
      or die "cannot open $filename for reading: $!";

I think you need to make a test program as I suggested, and if you don't
know how to do that, find a local perl programmer who does.

--
Ed Avis  

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

--------------------------------------------------------------------------
This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto.
(H1)