Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split() perl 5.005_03 #279

Closed
p5pRT opened this issue Jul 28, 1999 · 2 comments
Closed

split() perl 5.005_03 #279

p5pRT opened this issue Jul 28, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 28, 1999

Migrated from rt.perl.org#1101 (status was 'resolved')

Searchable as RT1101$

@p5pRT
Copy link
Author

p5pRT commented Jul 28, 1999

From cslye@calweb.com

I am just wondering if there is a known problem with split(). I have tried
to locate a bug report tracking system on-line to vrfy this before asking,
but failed to do so. Anyways the problem..

  ($website,$logdata) = split(/​:/, $newmsg, 2);

the input line is :
www.calweb.com​:207.211.93.239 - - [27/Jul/1999​:16​:41​:50 -0700] "GET / HTTP/1.0" 200 6512

$logdata is printed out to another file, but there are about 200 out of
225534 with the www.calweb.com​: still in them. Comparing the input line vs
whats in the output file, with od, and the lines are the same, so no random
chars in there screwing it up. I will put the entire code at the bottom of
this msg if it helps any more..

Thanks!!

#!/usr/bin/perl

require "cacheout.pl";
#use strict;
use IO​::Socket;
my($sock, $newmsg, $hisaddr, $hishost, $MAXLEN, $PORTNO, $website, $lastwebsite, $logdata);
$MAXLEN = 1024;
$PORTNO = 5151;
$sock = IO​::Socket​::INET->new(LocalPort => $PORTNO, Proto => 'udp')
  or die "socket​: $@​";
print "Awaiting UDP messages on port $PORTNO\n";

open INLOG, ">>inputlog";

while ($sock->recv($newmsg, $MAXLEN)) {

#net stuff
# my($port, $ipaddr) = sockaddr_in($sock->peername);
# $hishost = gethostbyaddr($ipaddr, AF_INET);
  ($website,$logdata) = split(/​:/, $newmsg, 2);
  print INLOG "$newmsg";

#file stuff

  if ($website ne $lastwebsite) {
  &cacheout($website);
  $lastwebsite = $website;
  }
  print $website $logdata;

}

die "recv​: $!";

Perl Info


Site configuration information for perl 5.00503:

Configured by markm at $Date: 1999/05/05 19:42:40 $.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=freebsd, osvers=4.0-current, archname=i386-freebsd
    uname='freebsd freefall.freebsd.org 4.0-current freebsd 4.0-current #0: $Date: 1999/05/05 19:42:40 $'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='undef', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=undef, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E'
    libpth=/usr/lib
    libs=-lm -lc -lcrypt
    libc=/usr/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so.3
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fpic', lddlflags='-shared'

Locally applied patches:
    


@INC for perl 5.00503:
    /usr/libdata/perl/5.00503/mach
    /usr/libdata/perl/5.00503
    /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00503:
    HOME=/s2/cslye
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/s2/cslye:/s2/cslye/bin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/lib:/usr/lib/X11:/usr/X11R6/include/X11:/usr/local/jdk1.1.5/bin:/usr/local/java/bin:.
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 1999

From @gsar

On Wed, 28 Jul 1999 13​:00​:20 PDT, Cameron Slye wrote​:

This is a bug report for perl from cslye@​calweb.com,
generated with the help of perlbug 1.26 running under perl 5.00503.

-----------------------------------------------------------------
[Please enter your report here]

I am just wondering if there is a known problem with split(). I have tried
to locate a bug report tracking system on-line to vrfy this before asking,
but failed to do so. Anyways the problem..

($website,$logdata) = split(/​:/, $newmsg, 2);

the input line is :
www.calweb.com​:207.211.93.239 - - [27/Jul/1999​:16​:41​:50 -0700] "GET / HTTP/1.0
" 200 6512

$logdata is printed out to another file, but there are about 200 out of
225534 with the www.calweb.com​: still in them. Comparing the input line vs
whats in the output file, with od, and the lines are the same, so no random
chars in there screwing it up. I will put the entire code at the bottom of
this msg if it helps any more..

Thanks!!

#!/usr/bin/perl

require "cacheout.pl";
#use strict;
use IO​::Socket;
my($sock, $newmsg, $hisaddr, $hishost, $MAXLEN, $PORTNO, $website, $lastwebsit
e, $logdata);
$MAXLEN = 1024;
$PORTNO = 5151;
$sock = IO​::Socket​::INET->new(LocalPort => $PORTNO, Proto => 'udp')
or die "socket​: $@​";
print "Awaiting UDP messages on port $PORTNO\n";

open INLOG, ">>inputlog";

while ($sock->recv($newmsg, $MAXLEN)) {

#net stuff
# my($port, $ipaddr) = sockaddr_in($sock->peername);
# $hishost = gethostbyaddr($ipaddr, AF_INET);
($website,$logdata) = split(/​:/, $newmsg, 2);
print INLOG "$newmsg";

#file stuff

if ($website ne $lastwebsite) {
&cacheout($website);
$lastwebsite = $website;
}
print $website $logdata;

}

die "recv​: $!";

Looks like a bug in your script. Since MAXLEN is 1024, you are
presumably reading more than one record on occasion.

Sarathy
gsar@​activestate.com

@p5pRT p5pRT closed this as completed Nov 28, 2003
jkeenan pushed a commit that referenced this issue Nov 2, 2023
0.000159  2023-10-25 14:09:23-07:00 America/Los_Angeles

    - Document that diag() intentionally returns false, and add a `return 0`

0.000158  2023-10-22 22:05:42-07:00 America/Los_Angeles

    - Mark Workflow-Acceptance.t as AUTHOR_TESTING

0.000157  2023-10-22 21:26:49-07:00 America/Los_Angeles

    - Fix #280: Document --no_srand option in Test2::V0
    - Fix #276: Document bool() import in Test2::V0
    - Fix #279: Merged fix for VMS test issues
    - Fix #277: Merged POD tweaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant