473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

print_r()

Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r()
function does in PHP?

Mark
Nov 25 '06 #1
7 4349

Mark wrote:
Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r()
function does in PHP?
I would ask this in a Perl group.
>
Mark
Nov 26 '06 #2

Mark wrote:
Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r()
function does in PHP?

Mark
Google for:

print_r() perl

and you get some leads.

Nov 26 '06 #3
"Mark" <Ma**********@noaa.govpíse v diskusním príspevku
news:ek**********@news.nems.noaa.gov...
Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r() function
does in PHP?
No, this function have no equivalent in Perl.
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Nov 26 '06 #4
Check out the Data::Dumper module. You can use it in a procedural
fashion as well as object-oriented.

On Nov 25, 8:07 am, Mark <Mark.Fenb...@noaa.govwrote:
Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r()
function does in PHP?

Mark
Nov 26 '06 #5
<la***@portcommodore.compíse v diskusním príspevku
news:11*********************@l39g2000cwd.googlegro ups.com...
>
Mark wrote:
>Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r()
function does in PHP?

Mark

Google for:

print_r() perl

and you get some leads.
Of course, Data::Dumper but this is a module not Perl function. Module is
similar to PHP class ;-)
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Nov 26 '06 #6
If you perldoc Data::Dumper, you'll see that you can use its procedural
interface, thanks to perl's use of namespaces:

Quoted from perldoc:
use Data::Dumper;

# simple procedural interface
print Dumper($foo, $bar);

As you can see, the module has a procedural interface. I noticed the
author of this thread started the same one in comp.lang.perl.modules,
if anyone's interested.

Also, note that if you want to dump an array or hash with the
Data::Dumper module, you need to pass it as a reference:

my %hash = ('a'=>'foo', 'b'=>'bar', 'c'=>'baz');
print Dumper(\%hash);

Curtis

Petr Vileta wrote:
<la***@portcommodore.compíse v diskusním príspevku
news:11*********************@l39g2000cwd.googlegro ups.com...

Mark wrote:
Many PHP function replicate Perl functions, but what about the other way
around. Is there anything for Perl that does what the print_r()
function does in PHP?

Mark
Google for:

print_r() perl

and you get some leads.
Of course, Data::Dumper but this is a module not Perl function. Module is
similar to PHP class ;-)
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Nov 27 '06 #7
Of course, Data::Dumper but this is a module not Perl function. Module is
similar to PHP class ;-)
Sorry, I just realized I didn't address your comment correctly. Doh!
Yes, you're right, it's a module, but like C or Java, most of Perl's
usefulness comes from the pre-built APIs. I do not believe there is any
native Perl functions that are even similar to print_r. If there were,
there probably wouldn't be a data dump module. ;-)

Nov 27 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Chris Allen | last post by:
Hi I'm new to PHP and I'm trying to create a Login Form. Once the user has logged in then he shouldn't have to log in again. The trouble is I'm getting a new session ID between every page and so...
2
by: Frank Yingst | last post by:
http://us3.php.net/manual/en/language.types.array.php anyone know what print_r is ? some sort of function for printing or what? where is this described?
15
by: weissborn | last post by:
I'm a php newbie. I have installed apache 2.0.54 and php 5.0.5 on my win2k box. However, it does not appear the php is working properly. I base this on the following code(which I got from a...
1
by: ChuckDemon | last post by:
Is there a .NET class or function to dump the contents of a variable/array/object/whatever to the console? Console.WriteLine( dump_variable( my_var ) ); Thanks.
3
by: meltedown | last post by:
Normally, if I use $result=print_r($array,TRUE); print_r prints nothing and $result is equal to the readable array. However, if $array is very large, print_r prints the array and returns...
3
by: comp.lang.php | last post by:
I have a counter that evokes the "Three Strikes You're Out" rule.. if you make more than N mistakes it auto-resets to avoid flooding $_SESSION with attempt after attempt, etc. However, the...
0
by: yawnmoth | last post by:
print_r uses "\n" to distinguish between subsequent elements of an array. This is fine unless you're trying to view the resultant file in something like Notepad. As such, without reimplementing...
6
by: lawpoop | last post by:
Hello! I am working on a map of a rather large php project that I've been working on. I hope to create a map of the files of the project that would look like the output of the unix 'tree'...
1
pbmods
by: pbmods | last post by:
Looking for a print_r() for JavaScript? Look no further! Finally, a decent way to figure out what's in that mysterious Array or Object! Note that this version of print_r() relies on (included)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.