I made a script this copy a line from my PHP page.
now I did this one: -
while($Res=~m/<br>uptime:(.+?)\<br>/g){
-
$uptime=$1;
-
}
-
its search for text start with: " uptime: "
then get the text what after this
The result needs to be something like: -
03:29:14 up 12 days, 7:08, 1 user, load average: 0.17, 0.15, 0.23
but when I try to do this:
the result is:
How can I fix it? (I want this will read only this line)
Thanks, tripc.
7 1125 numberwhun 3,509
Recognized Expert Moderator Specialist
I made a script this copy a line from my PHP page.
now I did this one:
while($Res=~m/<br>uptime:(.+?)\<br>/g){
$uptime=$1;
}
its search for text start with: " uptime: "
then get the text what after this
The result needs to be something like:
03:29:14 up 12 days, 7:08, 1 user, load average: 0.17, 0.15, 0.23
but when I try to do this:
print "$uptime<br>"
the result is:
03:29:14 up 12 days
How can I fix it? (I want this will read only this line)
Thanks, tripc.
You have posted your question under Perl Articles instead of the Perl Forum.
I have moved it across for you.
Please be sure to confine your questions to the Perl Forum in the future!
- MODERATOR
numberwhun 3,509
Recognized Expert Moderator Specialist
I made a script this copy a line from my PHP page.
now I did this one: -
while($Res=~m/<br>uptime:(.+?)\<br>/g){
-
$uptime=$1;
-
}
-
its search for text start with: " uptime: "
then get the text what after this
The result needs to be something like:
03:29:14 up 12 days, 7:08, 1 user, load average: 0.17, 0.15, 0.23
but when I try to do this:
print "$uptime<br>"
the result is:
03:29:14 up 12 days
How can I fix it? (I want this will read only this line)
Thanks, tripc.
It looks like you posted this same questions twice. Once to the Perl Articles and once to the Perl Forum. Please be sure and only post your questions to the Perl Forum, and only post them once.
Thank you!
Regards,
Jeff
KevinADC 4,059
Recognized Expert Specialist
I made a script this copy a line from my PHP page.
now I did this one: -
while($Res=~m/<br>uptime:(.+?)\<br>/g){
-
$uptime=$1;
-
}
-
its search for text start with: " uptime: "
then get the text what after this
The result needs to be something like:
03:29:14 up 12 days, 7:08, 1 user, load average: 0.17, 0.15, 0.23
but when I try to do this:
print "$uptime<br>"
the result is:
03:29:14 up 12 days
How can I fix it? (I want this will read only this line)
Thanks, tripc.
There is no way to know without seeing the text you are working with.
I just want this $uptime will show me the result
the line of 'uptime' of my PHP page: -
uptime: 03:29:14 up 12 days, 7:08, 1 user, load average: 0.17, 0.15, 0.23
but when I type $uptime I get this:
=\
I think I should do something like: -
while($Res=~m/<br>uptime:(.+?)\,(.+?)\,(.+?)\,(.+?)\,(.+?)\<br>/g){
-
$uptime=$1.$2.$3.$4.$5;
numberwhun 3,509
Recognized Expert Moderator Specialist
I just want this $uptime will show me the result
the line of 'uptime' of my PHP page:
uptime: 03:29:14 up 12 days, 7:08, 1 user, load average: 0.17, 0.15, 0.23
but when I type $uptime I get this:
03:29:14 up 12 days
=\
I think I should do something like:
while($Res=~m/<br>uptime:(.+?)\,(.+?)\,(.+?)\,(.+?)\,(.+?)\<br >/g){
$uptime=$1.$2.$3.$4.$5;
Instead of showing us how it is displayed on the web page, why not do a "view source" and show us the line that you are trying to match from there? That way, as Kevin said, we can see what you are trying to match.
Regards,
Jeff
Instead of showing us how it is displayed on the web page, why not do a "view source" and show us the line that you are trying to match from there? That way, as Kevin said, we can see what you are trying to match.
Regards,
Jeff
The commands are: -
$uptime = system(uptime);
-
echo "uptime: $uptime<br>";
-
system(uptime);
the result needs to be: -
15:24:50 up 12 days, 19:04, 1 user, load average: 0.41, 0.51, 0.45
and I use -
while($Res=~m/<br>uptime:(.+?)\<br>/g){
-
$uptime=$1;
-
}
Thanks, tripc.
KevinADC 4,059
Recognized Expert Specialist
forget it, I can't help somone that can't follow simple instructions.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark Wilson CPU |
last post by:
This must be easy, but I'm missing something...
I want to execute a Perl script, and capture ALL its output into a PHP
variable. Here are my 2 files:
-------------------------------------...
|
by: Greg Lindstrom |
last post by:
Hello-
I have a task which -- dare I say -- would be easy in <asbestos_undies>
Perl </asbestos_undies> but would rather do in Python (our primary
language at Novasys). I have a file with...
|
by: Matt Ittigson |
last post by:
I'm getting the following error(s) running perlcc and can't find any
explanation or work around. I'm including the errors and the script
itself. I get the same errors on a cygwin+Win2k box as a...
|
by: Firewalker |
last post by:
Hey guys,
I am newbie to perl. I am trying to deal with dates ( such trying to find
what the date would be after month). Is therea function or date class( I am
a java programmer, I couldnt find...
|
by: sir.linying |
last post by:
My php script is to call perl scipt which makes use of
Spreadsheet::ParseExcel module to parse Excel file. I am able to launch
php script from command line so that perl script can run and properly...
|
by: Otto J. Makela |
last post by:
I'm trying to install to php the Perl-1.0.0.tgz package (from
http://pecl.php.net/package/perl, enabling one to call perl libraries)
to a pre-existing Solaris system.
Unfortunately, the attempt...
|
by: OverTheTop |
last post by:
All the usual Newbie stuff applies...
I have a Windows2000 Server with ActivePerl and a module (DBD-Interbase) that worked fine. Trying to duplicate the environment on Windows2003 Server for...
|
by: Gaijinco |
last post by:
Hi my name is Carlos Obregón and I'm currently a profesor of C/C++
programming at the CUMD in Bogotá Colombia.
This last term I ask my students to develop an implementation of the
minesweeper...
|
by: islayer |
last post by:
can someone tell me what is wrong with the bold code? i am just learning perl. the program should create a perl file with a random name (5 letters, followed by a number), but the name is always just...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |