473,395 Members | 1,530 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,395 software developers and data experts.

Equivalent of Perl's $\ ????

Hi,

Is there an equivalent to Perl's output record separator, or input
record separator for that amtter, ( $\ and $/ ), in PHP?

Thanks,
Ed

Aug 3 '05 #1
5 1437
*** fo*******@gmail.com wrote/escribió (3 Aug 2005 00:38:31 -0700):
Is there an equivalent to Perl's output record separator, or input
record separator for that amtter, ( $\ and $/ ), in PHP?


I know nothing about Perl. What's this operator supposed to do?
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Aug 3 '05 #2
If you want to split somthing into array try
$record_array = preg_split("\#\","record1#record2#record3");

Aug 3 '05 #3
On 3 Aug 2005 02:16:53 -0700, Sergej Andrejev wrote:
If you want to split somthing into array try
$record_array = preg_split("\#\","record1#record2#record3");


Use explode() for simple record boundaries like this; it uses far less
resources (time, memory) than a call to the (p)regex lib.

--
Firefox Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Aug 3 '05 #4
> User-Agent: G2/0.2

Some usenauts have reportedly judged G2 users non compos
mentis enough to killfile them unread. Insufficient grounds
for sentencing, you might protest. Myself, not yet having
read what they've written, I'd return the verdict not proven.
It's just possible - sometimes - to have your posts appear
normal using Google Groups. It just takes a bit of doing.

--
Jock
Aug 3 '05 #5
It's a special variable that is used when you read data in from a Perl
file. It reads in chunks of data based on a delimiter.
The default is\n.

F.ex. if you know an input file has 3 new lines between paragraphs, yiu
can set $/ = "\n\n\n";

So insted of reading in line for line, you get the whole parachraphs as
chunks.
Of course the 3 new lines could instead be any pattern you want to use
as a delimiter.
Ed.

Aug 3 '05 #6

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

Similar topics

9
by: Coder Droid | last post by:
one feature of perl I'm desparately missing in php is using || to assign the first non-empty value in a list to a variable. For example, # perl example 1 $a = 1; $b = 2; $c = $a || $b; print...
0
by: Eric Wichterich | last post by:
Hello Pythonistas, does anyone know an equivalent python statement for perl's "next"-statement? (Perl's "next" skips a loop cycle and continues with the next loop cycle - it does not abort the...
1
by: Edward WIJAYA | last post by:
Hi, I am new to Python, and I like to learn more about it. Since I am used to Perl before, I would like to know what is Python equivalent of Perl code below: $filename = $ARGV;
3
by: Caj Zell | last post by:
Hello, I am looking a little bit at python and am curious of one thing I often use in perl. Suppose, I want to change the string "best_composer" to "Zappa" in a document called facts.txt, then...
5
by: mbbx6spp | last post by:
Hi All, I already searched this newsgroup and google groups to see if I could find a Python equivalent to Perl's Template::Extract, but didn't find anything leading to a Python module that had...
4
by: Susan Baker | last post by:
Hi, I'm working on s simple parser and I would like to split up multi-line expressions into single expressions. Is there a way whereby I could slurp the lines into an array (or other container)?...
2
by: Greger | last post by:
Hi is there any equivalent of perl's use strict; in PHP,?? TIA -- http://www.gregerhaga.net
12
by: rurpy | last post by:
Is there an effcient way (more so than cgi) of using Python with Microsoft IIS? Something equivalent to Perl-ISAPI?
35
by: lnatz | last post by:
Hi, Is there an equivalent to the perl command chomp in C? And if there is no exact equivalent command, how would I go about removing the "\n" at the end of a stdin? Thank you, Natalie
0
by: Gabriel Genellina | last post by:
En Thu, 08 May 2008 09:11:56 -0300, Michael Mabin <d3vvnull@gmail.comescribió: Like this? <code> import sys,fileinput for line in fileinput.input(inplace=True):...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
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
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.