الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

سؤالين في البيرل لأهل الخبرة

بدأه rmahg في 6 مارس 2010 · 2 رد · 1,884 مشاهدة · في لغة Perl
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

The Linux utility command echo takes any number of command-line arguments and prints them out, e.g.,

comp315@turing> echo Le language Perl est magnifique.

Le language Perl est magnifique.

Write the shortest Perl program that does the same thing (and call it myecho.pl), but separates the command-line arguments with "***", i.e.,

comp315@turing> ./myecho.pl Le language Perl est magnifique.

Le***language***Perl***est***magnifique.

Modify the above program such that it will use a subroutine to do the same thing. Call it myechosub.pl.

comp315@turing> ./myechosub.pl un deux troi quatre

un***deux***troi***quatre

#2

يا كثر دخلاتك يامازن

على هونك

#3
#!/usr/bin/perl

foreach $argnum (1 .. $#ARGV) {

 print "***$ARGV[$argnum]";

}

لم أجرب البرنامج لكن المفروض أنه يعمل

التواصل عبر هذا النموذج

http://idontknow.raslny.com

مواضيع مشابهة