public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problem with perl distro?
@ 2003-09-23 18:55 Peter M Aarestad
  0 siblings, 0 replies; 13+ messages in thread
From: Peter M Aarestad @ 2003-09-23 18:55 UTC (permalink / raw)
  To: cygwin


I have a script that I noticed was giving me problems with the Cygwin version of Perl when I ran it, but the same script works fine with the AcitveState version of Perl. The key lines of the main loop look like this:

while (<GUIFILE>) {
    chomp;

    if (!$desc and /^(\w+):$/) { # warning line
        # ...
    } elsif (/^\{$/) {
        # ...
    } elsif (/^\}$/) {
        # ...
    } elsif (!$desc and /^"?$screen"?\.(.+):/) {
        # ...
    } elsif ($desc and /^\s*id:\s*(\d+)$/) {
        # ...
    } else {
        # ...
    }
} # end while <GUIFILE>

Now, every single time I read in a line, I get this warning

Use of uninitialized value in concatenation (.) or string at ./genguimapdoc.pl line 60, <GUIFILE> line n.

However, I do NOT get this warning using ActiveState Perl, and the script works fine! Is this thus a bug in Cygwin's Perl build?

-peter

Peter Aarestad
aarestad@netzero.net
Law of Software Envelopment:
Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.
- Jamie Zawinski

________________________________________________________________
The best thing to hit the internet in years - NetZero HiSpeed!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month -visit www.netzero.com to sign up today!

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Problem with perl distro?
@ 2003-09-23 19:03 DePriest, Jason R.
  0 siblings, 0 replies; 13+ messages in thread
From: DePriest, Jason R. @ 2003-09-23 19:03 UTC (permalink / raw)
  To: cygwin

> Peter M Aarestad said
[-snip-]
> Now, every single time I read in a line, I get this warning
> 
> Use of uninitialized value in concatenation (.) or string at 
> ./genguimapdoc.pl line 60, <GUIFILE> line n.
> 
> However, I do NOT get this warning using ActiveState Perl, 
> and the script works fine! Is this thus a bug in Cygwin's Perl build?
[-/snip-]

Speaking of builds, can you please specify which version of perl you are
using under Cygwin and which version of ActiveState Perl you are using?

Also, if you run your script with ActiveState using the '-w' modifier
does it give you the same error you get with Cygwin perl?

-Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Problem with perl distro?
@ 2003-09-23 19:15 Peter M Aarestad
  0 siblings, 0 replies; 13+ messages in thread
From: Peter M Aarestad @ 2003-09-23 19:15 UTC (permalink / raw)
  To: jrdepriest; +Cc: cygwin


-- "DePriest, Jason R." <jrdepriest@ftb.com> wrote:

> Speaking of builds, can you please specify which version of perl you are
> using under Cygwin and which version of ActiveState Perl you are using?

According to setup.exe, I have cygwin 1.5.5-1 and perl 5.8.0-5 installed. My version of ActiveState Perl is 5.8.0 build 806 (just downloaded today to test this anomaly out). FWIW, I'm running everything on an NT4 SP6 machine.

> Also, if you run your script with ActiveState using the '-w' modifier
> does it give you the same error you get with Cygwin perl?

perl -w works fine for ActivePerl - no warnings. Plus, my script uses the "warnings" and "strict" pragmas.

Thanks,
-peter

Peter Aarestad
aarestad@netzero.net
Law of Software Envelopment:
Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.
- Jamie Zawinski

________________________________________________________________
The best thing to hit the internet in years - NetZero HiSpeed!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month -visit www.netzero.com to sign up today!

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Problem with perl distro?
@ 2003-09-23 19:32 DePriest, Jason R.
  0 siblings, 0 replies; 13+ messages in thread
From: DePriest, Jason R. @ 2003-09-23 19:32 UTC (permalink / raw)
  To: cygwin

> Peter M Aarestad said
[-snip-]
> perl -w works fine for ActivePerl - no warnings. Plus, my 
> script uses the "warnings" and "strict" pragmas.
[-/snip-]

Peter,

Can you provide a simple but complete script and data source that
recreate your error?
I don't know what the data you are parsing is supposed to look like so I
am having trouble coming up with something that gives me the error you
are talking about.
Also, I don't know what your variables are set to.

Thanks!
-Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Problem with perl distro?
@ 2003-09-23 19:45 Peter M Aarestad
  2003-09-23 19:53 ` Igor Pechtchanski
  2003-09-23 20:41 ` Gerrit P. Haase
  0 siblings, 2 replies; 13+ messages in thread
From: Peter M Aarestad @ 2003-09-23 19:45 UTC (permalink / raw)
  To: jrdepriest; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

-- "DePriest, Jason R." <jrdepriest@ftb.com> wrote:

> Can you provide a simple but complete script and data source that
> recreate your error?

This is too weird. I've stripped down my script to its roots, but now I'm getting warnings with ActivePerl too! This time, I'm getting warnings on every line with a colon in it, and just those lines, though Cygwin's perl is still reporting an error on every line Odd. Anyway, please find attached the stripped down script and the test file. I'm including the full version of the script, too ("genguimapdoc.pl" is the full version). Thanks much!

-peter

Peter Aarestad
aarestad@netzero.net
Law of Software Envelopment:
Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.
- Jamie Zawinski

[-- Attachment #2: genguimapdoc.pl --]
[-- Type: application/octet-stream, Size: 4857 bytes --]

#!/usr/bin/perl -w

use warnings;
use strict;
use CGI qw(:standard *table);

# Location of screen/field description file
my $screenflddescpath = "descriptions.txt";

open SCREENFLDDESC, $screenflddescpath
    or die "cannot find screen description file: $!";

my %screenflddesc;

while (<SCREENFLDDESC>) {
    chomp;
    my ($key, $desc) = split /,/;
    $screenflddesc{$key} = $desc;
}

close SCREENFLDDESC;

# Location of index file we will write results to
my $indexfile = ">screenindex.html";
open INDEX, $indexfile or die "cannot open index for writing: $!";

# Location of master GUI file
my $guipath = "Master.gui";
# my $guipath = "Master.gui.test";

open GUIFILE, $guipath or die "cannot find Master.gui: $!";

# Start our index file
print INDEX start_html("GUI Map Index"), "\n";
print INDEX h1("GUI Map Index"), "\n";
print INDEX "Click on a screen name below to go to its description page",
    br, "\n";
print INDEX hr, "\n";

# Flag to let us know if we're inside a description block
my $desc = 0;

# Current file name
my $currfile = "";

# Variables used in loop
my $screen;
my $screenname;
my $fldname;

while (<GUIFILE>) {
    chomp;

    # print "Line: $_\n";

    # Outside description block with no ".": Screen name
    # (or quoted name without following ".")
    # (Regex was originally /^([^.]+):$/)

    if (!$desc and /^(\w+):$/) {
        # print "Screen name: $1\n";

        # Save original version of name (possibly w/ quotes),
        # and strip away quotes (if present)
        $screen = $1;
        ($screenname = $screen) =~ tr/"//d;
        # Use the first 4 characters as the file name, replacing bad
        # characters with _
        (my $screenfilename = substr $screenname, 0, 4) =~ tr[ /][_];

        # If the current file doesn't have this name, finish it up
        # and open a new file
        if ($. == 1 or $currfile ne $screenfilename) {
            if ($. != 1) {
                print SCREEN end_table, end_html;
                close SCREEN;
            }
            # Some exceptions where we want the link name to be the
            # 4-letter file name
            my $sn = "";
            if ($screenname =~ /^(AACE|AM01|MOAC|WADV)/) {
                $sn = $screenfilename;
            } else {
                $sn = $screenname;
            }
            # Print a line to the index pointing to the new file to be
            # created
            print INDEX a({-href => "screens/$screenfilename.html"},
                          $sn), br, "\n";

            # Open a new screen file based on this screen name
            $currfile = $screenfilename;
            open SCREEN, ">screens/$screenfilename.html"
                or die "cannot create screens/$screenfilename.html: $!";
            print SCREEN start_html("Description of $screenname"), "\n";
            print SCREEN a({-href => "../screenindex.html"}, "Back"), "\n";
        } else {
            # Just close the previous table
            print SCREEN end_table, "\n";
            print SCREEN hr, "\n";
        }

        print SCREEN h1($screenname), "\n";
        print SCREEN h2("Description:"), "\n";
        if (defined $screenflddesc{$screenname}) {
            print SCREEN $screenflddesc{$screenname}, br, "\n";
        } else {
            print SCREEN "(No description)", br, "\n";
        }
        print SCREEN h2("Fields:"), "\n";
        print SCREEN start_table({-border => 1}), "\n";
        print SCREEN Tr(td(b("Field name")), td(b("Description")),
                        td(b("Location (row, column)"))), "\n";
    } elsif (/^\{$/) {
        # Start of a description block
        # print "Start of block\n";
        $desc = 1;
    } elsif (/^\}$/) {
        # End of a description block
        # print "End of block\n";
        $desc = 0;
    } elsif (!$desc and /^"?$screen"?\.(.+):/) {
        # print "Field name: $1\n";

        # Strip quotes from field name
        ($fldname = $1) =~ tr/"//d;
    } elsif ($desc and /^\s*id:\s*(\d+)$/) {
        # print "ID for field $fldname: $1\n";

        # The ID for the particular field
        # Get X and Y locations: X = int $id/80 + 1, Y = $id % 80 (or
        # 80 if $id % 80 == 0)
        my $xloc = int (($1/80) + 1);
        my $yloc = $1 % 80;
        if ($yloc == 0) {
            $yloc = 80;
        }
        # Get the description for this field (if it exists)
        my $key = $screenname . "." . $fldname;
        my $flddesc;
        if (defined ($screenflddesc{$key})) {
            $flddesc = $screenflddesc{$key};
        } else {
            $flddesc = "(No description)";
        }
        # Print row describing this field
        print SCREEN Tr(td($fldname), td($flddesc), td("Row $xloc, Column $yloc")), "\n";
    } else {
        # print "(ignored)\n";
    }
} # end while <GUIFILE>
print INDEX end_html;

close GUIFILE;
close INDEX;

[-- Attachment #3: Master.gui.test --]
[-- Type: application/octet-stream, Size: 1222 bytes --]

AACE_1:
{
 class: mic_if_win,
 label: "!AACE.*",
 mic_if_handles_windows: 1
}
{
 rtree_state: close,
 ltree_state: close
}
AACE_1."ADDR LINE1":
{
 class: field,
 id: 734
}
AACE_1."ADDR LINE2":
{
 class: field,
 id: 814
}
AACE_1.CITY_0:
{
 class: field,
 id: 888
}
AACE_1."HOME PHN":
{
 class: field,
 id: 944
}
AACE_1.NAME:
{
 class: field,
 id: 327
}
AACE_1.ST:
{
 class: field,
 id: 912
}
AACE_1.ZIP:
{
 class: field,
 id: 921
}
AACE_2:
{
 class: mic_if_win,
 label: screen32651,
 mic_if_handles_windows: 1
}
{
 rtree_state: close,
 ltree_state: close
}
AACE_2."ACQUISITION STRATEGY CODE":
{
 class: field,
 id: 1270
}
AACE_2."AUTO PAY ACCOUNT CODE":
{
 class: field,
 id: 1514
}
AACE_2."CLIENT PRODUCT ID":
{
 class: field,
 id: 553
}
AACE_2."CYCLE CODE":
{
 class: field,
 id: 834
}
AACE_2."DISCLOSURE GROUP":
{
 class: field,
 id: 1308
}
AACE_2."EMPLOYEE TYPE":
{
 class: field,
 id: 635
}
AACE_2."MINIMUM PAYMENT":
{
 class: field,
 id: 1392
}
AACE_2."PROVIDER 1":
{
 class: field,
 id: 430
}
AACE_2."SECURITIZATION POOL ID":
{
 class: field,
 id: 1110
}
AACE_2."TSYS PRODUCT CODE":
{
 class: field,
 id: 714
}

[-- Attachment #4: testgui.pl --]
[-- Type: application/octet-stream, Size: 889 bytes --]

#!/usr/bin/perl -w

use warnings;
use strict;

# Location of master GUI file
my $guipath = "Master.gui.test";
open GUIFILE, $guipath or die $!;

my $desc = 0;

# Current file name
my $currfile = "";

# Variables used in loop
my $screen;
my $screenname;
my $fldname;

while (<GUIFILE>) {
    chomp;

    if (!$desc and /^(\w+):$/) {
        print "Screen name: $1\n";
    } elsif (/^\{$/) {
        print "Start of block\n";
        $desc = 1;
    } elsif (/^\}$/) {
        # End of a description block
        print "End of block\n";
        $desc = 0;
    } elsif (!$desc and /^"?$screen"?\.(.+):/) {
        print "Field name: $1\n";
        # Strip quotes from field name
        ($fldname = $1) =~ tr/"//d;
    } elsif ($desc and /^\s*id:\s*(\d+)$/) {
        print "ID for field $fldname: $1\n";
    } else {
        print "(ignored)\n";
    }
} # end while <GUIFILE>
close GUIFILE;

[-- Attachment #5: Type: text/plain, Size: 218 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Problem with perl distro?
@ 2003-09-23 20:12 DePriest, Jason R.
  0 siblings, 0 replies; 13+ messages in thread
From: DePriest, Jason R. @ 2003-09-23 20:12 UTC (permalink / raw)
  To: cygwin

> Igor Pechtchanski said
> Peter,
> 
> $screen was uninitialized.  Changing it to 'my $screen = ""' 
> eliminates
> the warnings in the simpler script.
> 	Igor
> -- 

Igor,

Great job!  This seems to fix it under Cygwin perl 5.8.0-5, but I still
get errors using ActiveState Perl for Windows.  Which probably means
(unless Peter cannot get this fix working under Cygwin) that we should
take it off the list.

You are too fast... I had narrowed it down to that particular elsif, but
hadn't caught the problem yet...

-Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Problem with perl distro?
@ 2003-09-23 22:26 Peter M Aarestad
  0 siblings, 0 replies; 13+ messages in thread
From: Peter M Aarestad @ 2003-09-23 22:26 UTC (permalink / raw)
  To: cygwin



-- "DePriest, Jason R." <jrdepriest@ftb.com> wrote:


> Great job!  This seems to fix it under Cygwin perl 5.8.0-5, but I still
> get errors using ActiveState Perl for Windows.  Which probably means
> (unless Peter cannot get this fix working under Cygwin) that we should
> take it off the list.

Interesting. I'm checking my email on the run right now and will look at this later tonight to see if I can recreate this (I have a similar setup at home, only on WinXP instead of WinNT). Thanks for your quick answers, all. 

-peter

________________________________________________________________
The best thing to hit the internet in years - NetZero HiSpeed!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month -visit www.netzero.com to sign up today!

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-09-24  7:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-23 18:55 Problem with perl distro? Peter M Aarestad
2003-09-23 19:03 DePriest, Jason R.
2003-09-23 19:15 Peter M Aarestad
2003-09-23 19:32 DePriest, Jason R.
2003-09-23 19:45 Peter M Aarestad
2003-09-23 19:53 ` Igor Pechtchanski
2003-09-23 20:46   ` Gerrit P. Haase
2003-09-23 20:48   ` Gerrit P. Haase
2003-09-24  2:12     ` Peter M Aarestad
2003-09-24  7:55       ` Gerrit P. Haase
2003-09-23 20:41 ` Gerrit P. Haase
2003-09-23 20:12 DePriest, Jason R.
2003-09-23 22:26 Peter M Aarestad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).