#!/usr/bin/perl -w use strict; my @res; my ($users,$time,$up,$uptime,$res); @res = `/usr/bin/ftpcount --path=/var/run`; $time = time(); foreach $res (@res) { if ($res =~ /(\d+)\susers/) { $users = $1 } else { next } } $uptime = `uptime`; $uptime =~ /up (.*?),/; $up = $1; print "Content-type: text/html\r\n\r\n"; print "$users\n"; print "$users\n"; print "$up\n"; print "ftp.xxxxxx.com\n";
generates this:
Content-type: text/html Use of uninitialized value in concatenation (.) at ./ftpstat.pl line 2 +1. Use of uninitialized value in concatenation (.) at ./ftpstat.pl line 2 +2. 6:34 ftp.xxxxxx.com
what am i doing wrong?
2001-03-03 Edit by Corion : Changed title to something more descriptive, updated formatting.
In reply to Regex string concatenation (was: help please!)
by Balinor
For:
Use:
& & < < > > [ [ ] ]