Skip to content

Commit

Permalink
added helper for $/
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed May 13, 2013
1 parent 0f33a0b commit 2855598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Perl5/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@ class Perl5::Actions is HLL::Actions does STDActions {

method special_variable:sym<$/>($/) {
$V5DEBUG && say("special_variable:sym<\$/>($/)");
make QAST::Op.new( :op('call'), :name('&INPUT_RECORD_SEPARATOR') )
}

method special_variable:sym<$~>($/) {
Expand Down
4 changes: 3 additions & 1 deletion lib/Perl5/Terms.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

class Perl5::Terms;

my $INPUT_RECORD_SEPARATOR = 7;
sub INPUT_RECORD_SEPARATOR is export is rw { $INPUT_RECORD_SEPARATOR }

multi sub chop() is export { chop(CALLER::<$_>) }
multi sub chop(*@s is rw) is export {
Expand Down Expand Up @@ -34,7 +36,7 @@ multi sub open( $fh is rw, $m, $expr, *@list ) is export {
$fh = $expr.IO.open( :r($m eq '<'), :w($m eq '>'), :a($m eq '>>'), :p($m eq '|'), :bin(0) );
}

multi sub print( :$fh, *@text ) is export { ($fh || $*OUT).print( @text.join('') ) }
multi sub print( *@text ) is export { $*OUT.print( @text.join('') ) }

sub close( IO::Handle $fh ) is export { $fh.close }

Expand Down

0 comments on commit 2855598

Please sign in to comment.